summaryrefslogtreecommitdiff
path: root/libgfortran/generated/reshape_r16.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/reshape_r16.c')
-rw-r--r--libgfortran/generated/reshape_r16.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgfortran/generated/reshape_r16.c b/libgfortran/generated/reshape_r16.c
index 136d4f69b7e..c56b8717a83 100644
--- a/libgfortran/generated/reshape_r16.c
+++ b/libgfortran/generated/reshape_r16.c
@@ -78,6 +78,10 @@ reshape_r16 (gfc_array_r16 * 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_r16 (gfc_array_r16 * 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++)