From 35ca2d4ea7495018ae7c378e10baaa6eb2dbd06f Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Tue, 13 Aug 2019 18:43:00 +0000 Subject: re PR fortran/90563 (Out of bounds error when compiling with -Wextra) 2013-08-13 Thomas Koenig PR fortran/90563 * frontend-passes.c (insert_index): Suppress errors while simplifying the resulting expression. 2013-08-13 Thomas Koenig PR fortran/90563 * gfortran.dg/do_subsript_5.f90: New test. From-SVN: r274394 --- gcc/fortran/frontend-passes.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/fortran/frontend-passes.c') diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 37c767f..be99a06 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -2518,7 +2518,12 @@ insert_index (gfc_expr *e, gfc_symbol *sym, mpz_t val, mpz_t ret) data.sym = sym; mpz_init_set (data.val, val); gfc_expr_walker (&n, callback_insert_index, (void *) &data); + + /* Suppress errors here - we could get errors here such as an + out of bounds access for arrays, see PR 90563. */ + gfc_push_suppress_errors (); gfc_simplify_expr (n, 0); + gfc_pop_suppress_errors (); if (n->expr_type == EXPR_CONSTANT) { -- cgit v1.1