re PR middle-end/68339 (g++.dg/vect/simd-clone-2.cc ICEs with aggressive GC settings...
authorJakub Jelinek <jakub@redhat.com>
Fri, 20 Nov 2015 19:49:47 +0000 (20:49 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 20 Nov 2015 19:49:47 +0000 (20:49 +0100)
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
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr68339.c [new file with mode: 0644]

index e5607466d3631d0e6691b9cc4efb70b234135bd8..0b7194b848af28b60af81606135e335e1c8bd3e5 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/68339
+       * omp-low.c (expand_simd_clones): Call node->get_body () before
+       allocating stuff in GC.
+
 2015-11-20  Jim Wilson  <jim.wilson@linaro.org>
 
        * tree-vect-data-refs.c (compare_tree): Call STRIP_NOPS.
index 830db75a0e672176ca4dd0c109cd8ac1e53eb04c..0b6630bb7df5d367db5533bcce467068a2bef9e3 100644 (file)
@@ -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).  */
index d55f6dd231b87dc7502c1375be89d86dc5277ec5..de70aae1a04155bdb240ed1f6a83ab51a77d1f3d 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/68339
+       * gcc.dg/vect/pr68339.c: New test.
+
 2015-11-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * 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 (file)
index 0000000..ab0eede
--- /dev/null
@@ -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;
+}