From 9a784760f136a97e6cc39816788ca4ddff0193af Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 20 Nov 2015 20:49:47 +0100 Subject: [PATCH] re PR middle-end/68339 (g++.dg/vect/simd-clone-2.cc ICEs with aggressive GC settings and OpenMP) PR middle-end/68339 * omp-low.c (expand_simd_clones): Call node->get_body () before allocating stuff in GC. * gcc.dg/vect/pr68339.c: New test. From-SVN: r230671 --- gcc/ChangeLog | 6 ++++++ gcc/omp-low.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/vect/pr68339.c | 17 +++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/vect/pr68339.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e5607466d36..0b7194b848a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-11-20 Jakub Jelinek + + PR middle-end/68339 + * omp-low.c (expand_simd_clones): Call node->get_body () before + allocating stuff in GC. + 2015-11-20 Jim Wilson * tree-vect-data-refs.c (compare_tree): Call STRIP_NOPS. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 830db75a0e6..0b6630bb7df 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -18319,6 +18319,10 @@ expand_simd_clones (struct cgraph_node *node) && TYPE_ARG_TYPES (TREE_TYPE (node->decl)) == NULL_TREE) return; + /* Call this before creating clone_info, as it might ggc_collect. */ + if (node->definition && node->has_gimple_body_p ()) + node->get_body (); + do { /* Start with parsing the "omp declare simd" attribute(s). */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d55f6dd231b..de70aae1a04 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-20 Jakub Jelinek + + PR middle-end/68339 + * gcc.dg/vect/pr68339.c: New test. + 2015-11-20 Kyrylo Tkachov * gcc.target/arm/armv6-unaligned-load-ice.c: New test. diff --git a/gcc/testsuite/gcc.dg/vect/pr68339.c b/gcc/testsuite/gcc.dg/vect/pr68339.c new file mode 100644 index 00000000000..ab0eede62e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr68339.c @@ -0,0 +1,17 @@ +/* PR middle-end/68339 */ +/* { dg-do compile } */ +/* { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0 -fopenmp-simd" } */ + +#pragma omp declare simd notinbranch +int +f1 (int x) +{ + return x; +} + +#pragma omp declare simd notinbranch +int +f2 (int x) +{ + return x; +} -- 2.30.2