diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2006-05-26 23:18:45 +0200 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2006-05-26 21:18:45 +0000 |
commit | e8300d6eaf5937e3cd56b41f620f4380a21dab97 (patch) | |
tree | fd35e65870ed4ec00d662052926c0f3383969046 /gcc/fortran | |
parent | 7c7ce73aa7b6fece609d085e7ad265abf34e08f1 (diff) | |
download | gcc-e8300d6eaf5937e3cd56b41f620f4380a21dab97.zip gcc-e8300d6eaf5937e3cd56b41f620f4380a21dab97.tar.gz gcc-e8300d6eaf5937e3cd56b41f620f4380a21dab97.tar.bz2 |
re PR libfortran/27524 (-fbounds-check interacts with array function)
PR fortran/27524
* trans-array.c (gfc_trans_dummy_array_bias): Don't use stride as
a temporary variable when -fbounds-check is enabled, since its
value will be needed later.
* gfortran.dg/bounds_check_1.f90: New test.
From-SVN: r114142
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index eed3e0e..e4e2db2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2006-05-26 Francois-Xavier Coudert <coudert@clipper.ens.fr> + + PR fortran/27524 + * trans-array.c (gfc_trans_dummy_array_bias): Don't use stride as + a temporary variable when -fbounds-check is enabled, since its + value will be needed later. + 2006-05-26 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23151 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 32283a3..34742c3 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3564,7 +3564,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) tree dumdesc; tree tmp; tree stmt; - tree stride; + tree stride, stride2; tree stmt_packed; tree stmt_unpacked; tree partial; @@ -3711,9 +3711,9 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, ubound, lbound); - stride = build2 (MINUS_EXPR, gfc_array_index_type, + stride2 = build2 (MINUS_EXPR, gfc_array_index_type, dubound, dlbound); - tmp = fold_build2 (NE_EXPR, gfc_array_index_type, tmp, stride); + tmp = fold_build2 (NE_EXPR, gfc_array_index_type, tmp, stride2); gfc_trans_runtime_check (tmp, gfc_strconst_bounds, &block); } } |