diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-05-19 11:26:20 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-05-19 11:26:20 +0000 |
commit | 20733f1b0db2770532afaff274e9231de37e50fc (patch) | |
tree | 4928b71809951d83c26bef3d70029fb8f084c532 /gcc | |
parent | 9e1a0b35e9e3e366b70789a7f4b49c5b518ea229 (diff) | |
download | gcc-20733f1b0db2770532afaff274e9231de37e50fc.zip gcc-20733f1b0db2770532afaff274e9231de37e50fc.tar.gz gcc-20733f1b0db2770532afaff274e9231de37e50fc.tar.bz2 |
re PR fortran/78290 (Gfortran incorrectly creates a copy of an array passed to an array pointer dummy argument)
2019-05-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/78290
* gfortran.dg/pr78290.f90: New test.
From-SVN: r271379
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr78290.f90 | 35 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4dad098..1352e61 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2019-05-19 Thomas Koenig <tkoenig@gcc.gnu.org> + PR fortran/78290 + * gfortran.dg/pr78290.f90: New test. + +2019-05-19 Thomas Koenig <tkoenig@gcc.gnu.org> + PR fortran/88821 * gfortran.dg/alloc_comp_auto_array_3.f90: Add -O0 to dg-options to make sure the test for internal_pack is retained. diff --git a/gcc/testsuite/gfortran.dg/pr78290.f90 b/gcc/testsuite/gfortran.dg/pr78290.f90 new file mode 100644 index 0000000..fe0e319 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr78290.f90 @@ -0,0 +1,35 @@ +! { dg-do run } +! PR 78290 - used to give an ICE (with VOLATILE) and wrong +! code without it. +! Original test case by Andy Bennet. +PROGRAM main + IMPLICIT NONE + INTEGER,PARAMETER::KI=4 + + TYPE mytype + INTEGER(KIND=KI)::i=1_KI + END TYPE mytype + + TYPE(mytype), DIMENSION(9),TARGET, SAVE::ta + INTEGER(KIND=KI),DIMENSION(3),TARGET, SAVE::ia = 3_KI + INTEGER(KIND=KI),DIMENSION(:),POINTER ::ia2 =>NULL() + INTEGER(KIND=KI),DIMENSION(:),POINTER ::ip =>NULL() + volatile::ip + ALLOCATE(ia2(5)); ia2=2_KI + ip=>ia + if (size(ip) /= 3) stop 1 + CALL sub1(ip) + if (size(ip) /= 5) stop 2 + if (any(ia /= [3,3,3])) stop 3 + if (any (ip /= [2,2,2,2,2])) stop 4 + + ip=>ta%i + +CONTAINS + + SUBROUTINE sub1(ipa) + INTEGER(KIND=KI),DIMENSION(:),POINTER::ipa + ipa => ia2 + END SUBROUTINE sub1 + +END PROGRAM main |