From 56a3d28ba3f48c5d4c6d00c558e2432fd8b03d6e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 11 May 2016 15:16:48 +0200 Subject: [PATCH] re PR fortran/70855 (ICE with -fopenmp in gfc_trans_omp_workshare(): Bad statement code) PR fortran/70855 * frontend-passes.c (inline_matmul_assign): Disable in !$omp workshare. * gfortran.dg/gomp/pr70855.f90: New test. From-SVN: r236119 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/frontend-passes.c | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/gomp/pr70855.f90 | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr70855.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f683869f8c3..3d79fcaec21 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-05-11 Jakub Jelinek + + PR fortran/70855 + * frontend-passes.c (inline_matmul_assign): Disable in !$omp workshare. + 2016-05-09 Richard Biener PR fortran/70937 diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 7eeb5a68aa2..9d724dec0cd 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -2812,6 +2812,12 @@ inline_matmul_assign (gfc_code **c, int *walk_subtrees, if (in_where) 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. */ + if (in_omp_workshare) + return 0; + expr1 = co->expr1; expr2 = co->expr2; if (expr2->expr_type != EXPR_FUNCTION diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 12fd1d05fbe..019087254e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-11 Jakub Jelinek + + PR fortran/70855 + * gfortran.dg/gomp/pr70855.f90: New test. + 2016-05-11 Richard Biener PR middle-end/71002 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr70855.f90 b/gcc/testsuite/gfortran.dg/gomp/pr70855.f90 new file mode 100644 index 00000000000..247e4edd6ff --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr70855.f90 @@ -0,0 +1,18 @@ +! PR fortran/70855 +! { dg-do compile } +! { dg-additional-options "-O2" } + +program pr70855 + integer, parameter :: m = 4 + integer, parameter :: n = 2 + real :: a(m,n) + real :: x(n) + real :: y(m) + a = 1.0 + x = 1.0 +!$omp parallel +!$omp workshare + y(1:m) = matmul ( a(1:m,1:n), x(1:n) ) +!$omp end workshare +!$omp end parallel +end program pr70855 -- 2.30.2