From: krebbel Date: Wed, 25 Apr 2007 08:08:01 +0000 (+0000) Subject: 2007-04-25 Wolfgang Gellerich X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=4618299960f085b99e80e4698391d9e7645b3ca2;p=pf3gnuchains%2Fgcc-fork.git 2007-04-25 Wolfgang Gellerich * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124146 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa19f36f36f..52629abbdbe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2007-04-25 Wolfgang Gellerich + + * 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 * 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 92ba769ff49..1ab1a051373 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