aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2016-10-10 14:54:26 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2016-10-10 14:54:26 +0000
commit5f869266133f8ad66688c2ff7eaa6f7b0a0f21d0 (patch)
tree81daa01489f3f82ffbbcac8223f78118e1104e64 /gcc
parentdf48be86ac5f93b02b639da1a9295411d57c1c28 (diff)
downloadgcc-5f869266133f8ad66688c2ff7eaa6f7b0a0f21d0.zip
gcc-5f869266133f8ad66688c2ff7eaa6f7b0a0f21d0.tar.gz
gcc-5f869266133f8ad66688c2ff7eaa6f7b0a0f21d0.tar.bz2
re PR fortran/77915 (Internal error for matmul() in forall with optimization)
2016-10-10 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/77915 * frontend-passes.c (inline_matmul_assign): Return early if inside a FORALL statement. 2016-10-10 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/77915 * gfortran.dg/matmul_11.f90: New test. From-SVN: r240928
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/frontend-passes.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_11.f9014
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 49054dd..0c54c6b 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/77915
+ * frontend-passes.c (inline_matmul_assign): Return early if
+ inside a FORALL statement.
+
2016-10-07 Fritz Reese <fritzoreese@gmail.com>
* interface.c (compare_components): Check charlen for BT_CHAR.
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 54b8554..53b3c54 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -2857,6 +2857,11 @@ inline_matmul_assign (gfc_code **c, int *walk_subtrees,
if (in_where)
return 0;
+ /* The BLOCKS generated for the temporary variables and FORALL don't
+ mix. */
+ if (forall_level > 0)
+ return 0;
+
/* For now don't do anything in OpenMP workshare, it confuses
its translation, which expects only the allowed statements in there.
We should figure out how to parallelize this eventually. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 20c7aec..04966cf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/77915
+ * gfortran.dg/matmul_11.f90: New test.
+
2016-10-10 Jiong Wang <jiong.wang@arm.com>
* gcc.target/aarch64/advsimd-intrinsics/unary_scalar_op.inc: Support FMT64.
diff --git a/gcc/testsuite/gfortran.dg/matmul_11.f90 b/gcc/testsuite/gfortran.dg/matmul_11.f90
new file mode 100644
index 0000000..6907fa1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/matmul_11.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-ffrontend-optimize -fdump-tree-original" }
+! PR 77915 - ICE of matmul with forall.
+program x
+ integer, parameter :: d = 3
+ real,dimension(d,d,d) :: cube,xcube
+ real, dimension(d,d) :: cmatrix
+ integer :: i,j
+ forall(i=1:d,j=1:d)
+ xcube(i,j,:) = matmul(cmatrix,cube(i,j,:))
+ end forall
+end program x
+
+! { dg-final { scan-tree-dump-times "_gfortran_matmul" 1 "original" } }