diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2009-05-25 03:07:00 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2009-05-25 03:07:00 +0000 |
commit | 7ac6195704c2c071d24d43f36e292041cf65c9e3 (patch) | |
tree | addb86e9ecb9c6288fb90687361d529dbd351acc /gcc/fortran/trans-array.c | |
parent | ea74392e0926b55a8587c3aa2ea3f92a2ec3529a (diff) | |
download | gcc-7ac6195704c2c071d24d43f36e292041cf65c9e3.zip gcc-7ac6195704c2c071d24d43f36e292041cf65c9e3.tar.gz gcc-7ac6195704c2c071d24d43f36e292041cf65c9e3.tar.bz2 |
Dominique Dhumieres
2009-05-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Dominique Dhumieres
PR fortran/35732
PR fortran/39872
* trans-array.c (gfc_conv_ss_startstride): Add one to index.
* gfortran.dg/bounds_check_fail_3.f90: New test.
* gfortran.dg/bounds_check_fail_4.f90: New test.
* gfortran.dg/bounds_check_14.f90: Update test.
* gfortran.dg/bound_4.f90: Update test.
From-SVN: r147842
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index f4276ca..36a99a4 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3256,6 +3256,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop) info->start[n]); tmp = fold_build2 (FLOOR_DIV_EXPR, gfc_array_index_type, tmp, info->stride[n]); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + gfc_index_one_node, tmp); tmp = fold_build2 (MAX_EXPR, gfc_array_index_type, tmp, build_int_cst (gfc_array_index_type, 0)); /* We remember the size of the first section, and check all the |