diff options
Diffstat (limited to 'libgfortran/generated/reshape_c8.c')
-rw-r--r-- | libgfortran/generated/reshape_c8.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libgfortran/generated/reshape_c8.c b/libgfortran/generated/reshape_c8.c index e7d9f9dbb1db..6377049397b0 100644 --- a/libgfortran/generated/reshape_c8.c +++ b/libgfortran/generated/reshape_c8.c @@ -78,6 +78,10 @@ reshape_c8 (gfc_array_c8 * const restrict ret, index_type shape_data[GFC_MAX_DIMENSIONS]; rdim = GFC_DESCRIPTOR_EXTENT(shape,0); + /* rdim is always > 0; this lets the compiler optimize more and + avoids a potential warning. */ + GFC_ASSERT(sdim>0); + if (rdim != GFC_DESCRIPTOR_RANK(ret)) runtime_error("rank of return array incorrect in RESHAPE intrinsic"); @@ -232,6 +236,11 @@ reshape_c8 (gfc_array_c8 * const restrict ret, } sdim = GFC_DESCRIPTOR_RANK (source); + + /* sdim is always > 0; this lets the compiler optimize more and + avoids a warning. */ + GFC_ASSERT(sdim>0); + ssize = 1; sempty = 0; for (n = 0; n < sdim; n++) |