]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/gcc-tumbl.git/commitdiff
PR tree-optimization/53409
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 May 2012 21:02:40 +0000 (21:02 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 May 2012 21:02:40 +0000 (21:02 +0000)
* tree-vect-loop.c (vect_analyze_loop_operations): Don't check
vinfo_for_stmt (op_def_stmt) if op_def_stmt isn't inside loop.

* gcc.c-torture/compile/pr53409.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187739 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr53409.c [new file with mode: 0644]
gcc/tree-vect-loop.c

index 82d93b34826fca76335605defaa9dcf5e4f99848..516697547126eba56d7bcc02ff0b7a9786d3bb86 100644 (file)
@@ -1,5 +1,9 @@
 2012-05-21  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/53409
+       * tree-vect-loop.c (vect_analyze_loop_operations): Don't check
+       vinfo_for_stmt (op_def_stmt) if op_def_stmt isn't inside loop.
+
        PR tree-optimization/53410
        * fold-const.c (fold_binary_loc): Use build_zero_cst (type)
        instead of build_int_cst (type, 0) where vector types might be
index 25809564728d1afcfd3c1f36fe3270ac85149f5c..1d3f4816cceacb868b145be352ed48b17d22947c 100644 (file)
@@ -1,5 +1,8 @@
 2012-05-21  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/53409
+       * gcc.c-torture/compile/pr53409.c: New test.
+
        PR tree-optimization/53410
        * gcc.c-torture/compile/pr53410-1.c: New test.
        * gcc.c-torture/compile/pr53410-2.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr53409.c b/gcc/testsuite/gcc.c-torture/compile/pr53409.c
new file mode 100644 (file)
index 0000000..1bf478e
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR tree-optimization/53409 */
+
+int a, c, d, e, f;
+int b[0];
+
+int
+main ()
+{
+  if (f)
+    e = 0;
+  int g = d;
+  for (c = 0; c <= 1; c++)
+    {
+      for (a = 0; a <= 1; a = (char) a + 1)
+       b[c] = g;
+      a = 0;
+    }
+  return 0;
+}
index 1d0818c7ced811db8fa501f8b263ebb42ab097d3..65dec8922dca2a4bca8b06ce90f6802e7fb7c4ea 100644 (file)
@@ -1326,7 +1326,9 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo, bool slp)
                     return false;
 
                   op_def_stmt = SSA_NAME_DEF_STMT (phi_op);
-                  if (!op_def_stmt || !vinfo_for_stmt (op_def_stmt))
+                 if (!op_def_stmt
+                     || !flow_bb_inside_loop_p (loop, gimple_bb (op_def_stmt))
+                     || !vinfo_for_stmt (op_def_stmt))
                     return false;
 
                   if (STMT_VINFO_RELEVANT (vinfo_for_stmt (op_def_stmt))