aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/simplify.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 95c5279..d1892de 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * simplify.c (simplify_transformation_to_array): Silence
+ array bounds warning. Fix whitespace.
+
2017-01-04 Alexandre Oliva <aoliva@redhat.com>
* module.c (load_omp_udrs): Initialize name.
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index a5a50de..c5e7b67 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -610,9 +610,18 @@ simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *d
n++;
if (n < result->rank)
{
- count [n]++;
+#pragma GCC diagnostic push
+ /* If the nested loop is unrolled GFC_MAX_DIMENSIONS
+ times, we'd warn for the last iteration, because the
+ array index will have already been incremented to the
+ array sizes, and we can't tell that this must make
+ the test against result->rank false, because ranks
+ must not exceed GFC_MAX_DIMENSIONS. */
+#pragma GCC diagnostic ignored "-Warray-bounds"
+ count[n]++;
base += sstride[n];
dest += dstride[n];
+#pragma GCC diagnostic pop
}
else
done = true;