]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/62073 (Segmentation fault with tree vectorize)
authorFelix Yang <fei.yang0953@gmail.com>
Wed, 13 Aug 2014 10:11:49 +0000 (10:11 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 13 Aug 2014 10:11:49 +0000 (10:11 +0000)
2014-08-13  Felix Yang  <fei.yang0953@gmail.com>

PR tree-optimization/62073
* tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
a basic block.

* gcc.dg/vect/pr62073.c: New test.

From-SVN: r213904

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr62073.c [new file with mode: 0644]
gcc/tree-vect-loop.c

index e7771545c2084d11a3e1a732322ae0844a8268e3..8bcd63fc19edd2aad6aede77d7ed0d7488b6cefb 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
+
+       PR tree-optimization/62073
+       * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
+       a basic block.
+
 2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        Backport from mainline
index bcb2b66eff97e6756b860c6abfc719cc3d5caf58..0a2ddbed3fa77211caa3fa106fb985b1e0b39ec8 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
+
+       PR tree-optimization/62073
+       * gcc.dg/vect/pr62073.c: New test.
+
 2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        Backport from mainline
diff --git a/gcc/testsuite/gcc.dg/vect/pr62073.c b/gcc/testsuite/gcc.dg/vect/pr62073.c
new file mode 100644 (file)
index 0000000..15f2ad6
--- /dev/null
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O1" } */
+
+struct S0
+{
+  int f7;
+};
+struct S0 g_50;
+int g_70;
+int g_76;
+
+int foo (long long p_56, int * p_57)
+{
+  int *l_77;
+  int l_101;
+
+  for (; g_70;)
+    {
+      int **l_78 = &l_77;
+      if (g_50.f7)
+       continue;
+      *l_78 = 0;
+    }
+  for (g_76 = 1; g_76 >= 0; g_76--)
+    {
+      int *l_90;
+      for (l_101 = 4; l_101 >= 0; l_101--)
+       if (l_101)
+         *l_90 = 0;
+       else
+         {
+           int **l_113 = &l_77;
+           *l_113 = p_57;
+         }
+    }
+
+  return *l_77;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
index 7607d956d9ef29adc9cfad4d6e7315806818c7c6..dd10d87ffcb727a8f8f36623f001fbb108017d75 100644 (file)
@@ -2205,7 +2205,8 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
         }
 
       def1 = SSA_NAME_DEF_STMT (op1);
-      if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
+      if (gimple_bb (def1)
+         && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
           && loop->inner
           && flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
           && is_gimple_assign (def1))