summaryrefslogtreecommitdiff
path: root/gcc/fortran/dependency.c
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-01 13:11:36 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-01 13:11:36 +0000
commit3d3e0f7dd08d70582d30aae016a90a585b96895d (patch)
tree8f9ca6c80481c38590f0340e4ff70275e32c2d6e /gcc/fortran/dependency.c
parentd874c55e0036822ac2b9999914773a1ba0450287 (diff)
downloadgcc-3d3e0f7dd08d70582d30aae016a90a585b96895d.tar.gz
2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/31732 * dependency.c (gfc_full_array_ref_p): If the reference is to a single element, check that the array has a single element and that the correct element is referenced. 2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/31732 * gfortran.dg/array_memset_2: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124326 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/dependency.c')
-rw-r--r--gcc/fortran/dependency.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index b79f2229835..bdda6d871d3 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -1126,6 +1126,24 @@ gfc_full_array_ref_p (gfc_ref *ref)
for (i = 0; i < ref->u.ar.dimen; i++)
{
+ /* If we have a single element in the reference, we need to check
+ that the array has a single element and that we actually reference
+ the correct element. */
+ if (ref->u.ar.dimen_type[i] == DIMEN_ELEMENT)
+ {
+ if (!ref->u.ar.as
+ || !ref->u.ar.as->lower[i]
+ || !ref->u.ar.as->upper[i]
+ || gfc_dep_compare_expr (ref->u.ar.as->lower[i],
+ ref->u.ar.as->upper[i])
+ || !ref->u.ar.start[i]
+ || gfc_dep_compare_expr (ref->u.ar.start[i],
+ ref->u.ar.as->lower[i]))
+ return false;
+ else
+ continue;
+ }
+
/* Check the lower bound. */
if (ref->u.ar.start[i]
&& (!ref->u.ar.as