diff options
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r-- | gcc/fortran/simplify.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; |