aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Gellerich <gellerich@de.ibm.com>2007-04-25 08:08:01 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2007-04-25 08:08:01 +0000
commitbef4d1848d28adf3da938a0857b8132fe3ea50b5 (patch)
tree8db81cd8872a377a99cd332d253e4825c4abaf6a
parentf5c7290e1e8e7401914ebcabff4f39067e5d8220 (diff)
downloadgcc-bef4d1848d28adf3da938a0857b8132fe3ea50b5.zip
gcc-bef4d1848d28adf3da938a0857b8132fe3ea50b5.tar.gz
gcc-bef4d1848d28adf3da938a0857b8132fe3ea50b5.tar.bz2
equiv_6.f90 (set_arrays): Replaced subroutine with two new subroutines to avoid parameter-induced aliasing.
2007-04-25 Wolfgang Gellerich <gellerich@de.ibm.com> * gfortran.dg/equiv_6.f90 (set_arrays): Replaced subroutine with two new subroutines to avoid parameter-induced aliasing. * gfortran.dg/equiv_6.f90 (set_array_listpr): New. * gfortran.dg/equiv_6.f90 (set_array_lisbit): New. From-SVN: r124146
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/equiv_6.f9026
2 files changed, 27 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index aa19f36..52629ab 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-25 Wolfgang Gellerich <gellerich@de.ibm.com>
+
+ * gfortran.dg/equiv_6.f90 (set_arrays): Replaced subroutine
+ with two new subroutines to avoid parameter-induced aliasing.
+ * gfortran.dg/equiv_6.f90 (set_array_listpr): New.
+ * gfortran.dg/equiv_6.f90 (set_array_lisbit): New.
+
2007-04-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* gcc.dg/Warray-bounds.c: XFAIL test on 32-bit hppa targets.
diff --git a/gcc/testsuite/gfortran.dg/equiv_6.f90 b/gcc/testsuite/gfortran.dg/equiv_6.f90
index 92ba769..1ab1a05 100644
--- a/gcc/testsuite/gfortran.dg/equiv_6.f90
+++ b/gcc/testsuite/gfortran.dg/equiv_6.f90
@@ -14,7 +14,13 @@ program check_6
(lispat(1),listpr(10))
lischk = (/0, 0, 0, 0, 0, 0, 0, 0, 0, 1, &
2, 0, 0, 5, 6, 7, 8, 9,10, 0/)
- call set_arrays (listpr, lisbit)
+
+! These two calls replace the previously made call to subroutine
+! set_arrays which was erroneous because of parameter-induced
+! aliasing.
+ call set_array_listpr (listpr)
+ call set_array_lisbit (lisbit)
+
if (any (listpr.ne.lischk)) call abort ()
call sub1
call sub2
@@ -28,7 +34,8 @@ subroutine sub1
equivalence (listpr(10),lisbit(1)), &
(listpr(10),mwkx(10)), &
(listpr(10),lispat(1))
- call set_arrays (listpr, lisbit)
+ call set_array_listpr (listpr)
+ call set_array_lisbit (lisbit)
if (any (listpr .ne. lischk)) call abort ()
end
!
@@ -41,7 +48,8 @@ subroutine sub2
dimension listpr(20),lisbit(10),lispat(8)
equivalence (lispat(1),listpr(10)), &
(mwkx(10),lisbit(1),listpr(10))
- call set_arrays (listpr, lisbit)
+ call set_array_listpr (listpr)
+ call set_array_lisbit (lisbit)
if (any (listpr .ne. lischk)) call abort ()
end
! This gave correct results because the order in which the
@@ -52,12 +60,18 @@ subroutine sub3
dimension listpr(20),lisbit(10),lispat(8)
equivalence (listpr(10),lisbit(1),mwkx(10)), &
(lispat(1),listpr(10))
- call set_arrays (listpr, lisbit)
+ call set_array_listpr (listpr)
+ call set_array_lisbit (lisbit)
if (any (listpr .ne. lischk)) call abort ()
end
-subroutine set_arrays (listpr, lisbit)
- dimension listpr(20),lisbit(10)
+
+subroutine set_array_listpr (listpr)
+ dimension listpr(20)
listpr = 0
+end
+
+subroutine set_array_lisbit (lisbit)
+ dimension lisbit(10)
lisbit = (/(i, i = 1, 10)/)
lisbit((/3,4/)) = 0
end