From d1ecece9af3adc46eb1cc716608c38692d57f9c1 Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Fri, 8 Jun 2018 22:04:11 +0000 Subject: re PR fortran/85631 (Runtime error message array bound mismatch with nonzero optimization) 2018-06-08 Thomas Koenig PR fortran/85631 * trans.h (gfc_ss): Add field no_bounds_check. * trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and ss->no_bounds_check is set, do not use runtime checks. * trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check for reallocatable lhs. 2018-06-08 Thomas Koenig PR fortran/85631 * gfortran.dg/bounds_check_20.f90: New test. From-SVN: r261348 --- gcc/fortran/trans-array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-array.c') diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 7e6cea1..97c4725 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -4304,7 +4304,7 @@ done: } } - /* The rest is just runtime bound checking. */ + /* The rest is just runtime bounds checking. */ if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) { stmtblock_t block; @@ -4334,7 +4334,7 @@ done: continue; /* Catch allocatable lhs in f2003. */ - if (flag_realloc_lhs && ss->is_alloc_lhs) + if (flag_realloc_lhs && ss->no_bounds_check) continue; expr = ss_info->expr; -- cgit v1.1