aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2016-08-07 13:24:32 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2016-08-07 13:24:32 +0000
commit6ab5813c5b424d2749b92b9e996fc37e74b24850 (patch)
treeb93ca5e124bf63c50ffe5e1bd01c84f326126afb /gcc
parent27bddc4ace7dceda22968f2d89c537cb8a306302 (diff)
downloadgcc-6ab5813c5b424d2749b92b9e996fc37e74b24850.zip
gcc-6ab5813c5b424d2749b92b9e996fc37e74b24850.tar.gz
gcc-6ab5813c5b424d2749b92b9e996fc37e74b24850.tar.bz2
re PR fortran/71961 (178.galgel in SPEC CPU 2000 is miscompiled)
2016-08-07 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/71961 * gfortran.dg/matmul_10.f90: New testcase. From-SVN: r239220
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_10.f9022
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fece69c..bc95f00 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/71961
+ * gfortran.dg/matmul_10.f90: New testcase.
+
2016-08-07 Jan Hubicka <hubicka@ucw.cz>
* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Update testcase.
diff --git a/gcc/testsuite/gfortran.dg/matmul_10.f90 b/gcc/testsuite/gfortran.dg/matmul_10.f90
new file mode 100644
index 0000000..55f1c9c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/matmul_10.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! { dg-options "-Warray-temporaries" }
+! PR 71961 - no array temporary was created.
+! Original test case by Joost VandeVondele
+program main
+ implicit none
+ integer :: i
+ integer, dimension(:,:), pointer :: a
+ integer, dimension(:,:), allocatable :: b
+ ALLOCATE(a(4,4),b(4,2))
+ a=1 ; b=2
+ a(:,1:2)=matmul(a(:,1:4),b(:,:)) ! { dg-warning "Creating array temporary" }
+ if (any(a /= reshape((/8,8,8,8,8,8,8,8,1,1,1,1,1,1,1,1/),(/4,4/)))) &
+ call abort
+ a = reshape([((-1**i)*i,i=1,16)],[4,4])
+ b = reshape([((-1**(i-1))*i**2,i=1,8)],[4,2])
+ b(1:2,1:2) = matmul(a(1:2,:),b) ! { dg-warning "Creating array temporary" }
+ if (any(b /= reshape([310, 340, -9, -16, 1478, 1652, -49, -64],[4,2]))) &
+ call abort
+ deallocate(a)
+ deallocate(b)
+end program main