diff options
author | Mikael Morin <mikael.morin@tele2.fr> | 2009-01-19 23:19:34 +0100 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2009-01-19 22:19:34 +0000 |
commit | 9295d9eda367410dec7f531b76fb8b120ffd6375 (patch) | |
tree | f4dece352a8ed71d31519c9053b6277246a3edc4 /gcc | |
parent | f68211cd04d4083f4c12542f1b56ac09e995f9fd (diff) | |
download | gcc-9295d9eda367410dec7f531b76fb8b120ffd6375.zip gcc-9295d9eda367410dec7f531b76fb8b120ffd6375.tar.gz gcc-9295d9eda367410dec7f531b76fb8b120ffd6375.tar.bz2 |
re PR fortran/38859 (ubound and lbound treat structure component references as whole arrays)
2009-01-19 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/38859
* simplify.c (simplify_bound): Don't use array specification
if variable or component has subsequent references.
2009-01-19 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/38859
* gfortran.dg/bound_5.f90: New test.
From-SVN: r143501
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/simplify.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/bound_5.f90 | 26 |
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a5244ab..2f33c65 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2009-01-19 Mikael Morin <mikael.morin@tele2.fr> + + PR fortran/38859 + * simplify.c (simplify_bound): Don't use array specification + if variable or component has subsequent references. + 2009-01-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/38657 diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 90c91ae..c460f31 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -2253,7 +2253,10 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) case AR_FULL: /* We're done because 'as' has already been set in the previous iteration. */ - goto done; + if (!ref->next) + goto done; + + /* Fall through. */ case AR_SECTION: case AR_UNKNOWN: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f42d58..bbe8975 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-01-19 Mikael Morin <mikael.morin@tele2.fr> + + PR fortran/38859 + * gfortran.dg/bound_5.f90: New test. + 2009-01-18 H.J. Lu <hongjiu.lu@intel.com> PR target/38736 diff --git a/gcc/testsuite/gfortran.dg/bound_5.f90 b/gcc/testsuite/gfortran.dg/bound_5.f90 new file mode 100644 index 0000000..04245d6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bound_5.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! +! PR fortran/38859 +! Wrong bounds simplification +! +! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com> + + type x + integer I + end type x + type (x) A(0:5, 2:8) + integer ida(2) + + ida = lbound(a) + if (any(ida /= (/0,2/))) call abort + + ida = lbound(a%i) + if (any(ida /= (/1,1/))) call abort + + ida = ubound(a) + if (any(ida /= (/5,8/))) call abort + + ida = ubound(a%i) + if (any(ida /= (/6,7/))) call abort + + end |