From 699e8cb7b4d067cabff5a92bdbbb2d0d0dddc262 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 21 Nov 2016 20:17:36 +0100 Subject: [PATCH] re PR middle-end/67335 (ICE in compiling omp simd function with unused argument) PR middle-end/67335 * omp-simd-clone.c (simd_clone_adjust_argument_types): Use NULL prefix for tmp simd array if DECL_NAME (parm) is NULL. * g++.dg/vect/simd-clone-7.cc: New test. From-SVN: r242678 --- gcc/ChangeLog | 6 ++++++ gcc/omp-simd-clone.c | 5 +++-- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/vect/simd-clone-7.cc | 10 ++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/vect/simd-clone-7.cc diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d546162cc64..9cb252625bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-21 Jakub Jelinek + + PR middle-end/67335 + * omp-simd-clone.c (simd_clone_adjust_argument_types): Use NULL prefix + for tmp simd array if DECL_NAME (parm) is NULL. + 2016-11-20 Jeff Law PR target/25128 diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c index 15f80ab0766..7b8d2a9dc8a 100644 --- a/gcc/omp-simd-clone.c +++ b/gcc/omp-simd-clone.c @@ -630,8 +630,9 @@ simd_clone_adjust_argument_types (struct cgraph_node *node) if (node->definition) sc->args[i].simd_array - = create_tmp_simd_array (IDENTIFIER_POINTER (DECL_NAME (parm)), - parm_type, sc->simdlen); + = create_tmp_simd_array (DECL_NAME (parm) + ? IDENTIFIER_POINTER (DECL_NAME (parm)) + : NULL, parm_type, sc->simdlen); } adjustments.safe_push (adj); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d672a47a8e7..dd89d886503 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-11-21 Jakub Jelinek + PR middle-end/67335 + * g++.dg/vect/simd-clone-7.cc: New test. + PR c++/71973 * g++.dg/torture/pr53321.C (size_t): Use __SIZE_TYPE__ instead of long unsigned int. diff --git a/gcc/testsuite/g++.dg/vect/simd-clone-7.cc b/gcc/testsuite/g++.dg/vect/simd-clone-7.cc new file mode 100644 index 00000000000..fd5751b30bb --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/simd-clone-7.cc @@ -0,0 +1,10 @@ +// PR middle-end/67335 +// { dg-do compile } +// { dg-additional-options "-fopenmp-simd" } + +#pragma omp declare simd notinbranch uniform(y) +float +bar (float x, float *y, int) +{ + return y[0] + y[1] * x; +} -- 2.30.2