From cf352092e2ec219b0c841cb6e49d876a4b312bca Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 22 Sep 2016 13:17:24 +0200 Subject: [PATCH] re PR tree-optimization/77665 (ICE in expand_GOMP_SIMD_VF, at internal-fn.c:172) PR fortran/77665 * tree-inline.c (remap_gimple_stmt): Set has_simduid_loops for all IFN_GOMP_SIMD_* internal fns, not just for IFN_GOMP_SIMD_ORDERED_*. * gfortran.dg/gomp/pr77665.f90: New test. From-SVN: r240348 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/gomp/pr77665.f90 | 18 ++++++++++++++++++ gcc/tree-inline.c | 18 +++++++++++++----- 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr77665.f90 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 816ca50ccd8..0b689ab86df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-09-22 Jakub Jelinek + + PR fortran/77665 + * tree-inline.c (remap_gimple_stmt): Set has_simduid_loops + for all IFN_GOMP_SIMD_* internal fns, not just for + IFN_GOMP_SIMD_ORDERED_*. + 2016-09-21 Michael Meissner PR target/77670 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c354612164c..08911219f16 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-22 Jakub Jelinek + + PR fortran/77665 + * gfortran.dg/gomp/pr77665.f90: New test. + 2016-09-22 Paul Thomas * gfortran.dg/dtio_11.f90: Correct for changed error messages. diff --git a/gcc/testsuite/gfortran.dg/gomp/pr77665.f90 b/gcc/testsuite/gfortran.dg/gomp/pr77665.f90 new file mode 100644 index 00000000000..50183cbce6d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr77665.f90 @@ -0,0 +1,18 @@ +! PR fortran/77665 +! { dg-do compile } +! { dg-additional-options "-O2" } + +program pr77665 + type t + integer :: a = 0 + end type + type(t) :: x + integer :: i + !$omp declare reduction (+:t: omp_out%a = omp_out%a + omp_in%a) + !$omp simd reduction(+:x) + do i = 1, 8 + if (abs(i) < 5) call abort + x%a = x%a + 1 + end do + print *, x%a +end diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 83ba4234177..8a06e29d932 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1644,11 +1644,19 @@ remap_gimple_stmt (gimple *stmt, copy_body_data *id) gimple_call_set_tail (call_stmt, false); if (gimple_call_from_thunk_p (call_stmt)) gimple_call_set_from_thunk (call_stmt, false); - if (gimple_call_internal_p (call_stmt) - && IN_RANGE (gimple_call_internal_fn (call_stmt), - IFN_GOMP_SIMD_ORDERED_START, - IFN_GOMP_SIMD_ORDERED_END)) - DECL_STRUCT_FUNCTION (id->dst_fn)->has_simduid_loops = true; + if (gimple_call_internal_p (call_stmt)) + switch (gimple_call_internal_fn (call_stmt)) + { + case IFN_GOMP_SIMD_LANE: + case IFN_GOMP_SIMD_VF: + case IFN_GOMP_SIMD_LAST_LANE: + case IFN_GOMP_SIMD_ORDERED_START: + case IFN_GOMP_SIMD_ORDERED_END: + DECL_STRUCT_FUNCTION (id->dst_fn)->has_simduid_loops = true; + break; + default: + break; + } } /* Remap the region numbers for __builtin_eh_{pointer,filter}, -- 2.30.2