OSDN Git Service

2011-03-01 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Mar 2011 13:18:25 +0000 (13:18 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Mar 2011 13:18:25 +0000 (13:18 +0000)
PR tree-optimization/47890
* tree-vect-loop.c (get_initial_def_for_induction): Set
related stmt properly.

* gcc.dg/torture/pr47890.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170593 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 79487c1..c64de9d 100644 (file)
@@ -1,5 +1,11 @@
 2011-03-01  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/47890
+       * tree-vect-loop.c (get_initial_def_for_induction): Set
+       related stmt properly.
+
+2011-03-01  Richard Guenther  <rguenther@suse.de>
+
        PR lto/47924
        * lto-streamer.c (lto_record_common_node): Also register
        the canonical type.
index d5e79f8..94bbe7e 100644 (file)
@@ -1,5 +1,10 @@
 2011-03-01  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/47890
+       * gcc.dg/torture/pr47890.c: New testcase.
+
+2011-03-01  Richard Guenther  <rguenther@suse.de>
+
        PR lto/47924
        * gcc.dg/lto/pr47924_0.c: New testcase.
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr47890.c b/gcc/testsuite/gcc.dg/torture/pr47890.c
new file mode 100644 (file)
index 0000000..83cb5e6
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void f(char *s)
+{
+  signed short i;
+
+  for (i = 0; i < 19; i = i + 1)
+    s[i] = i;
+}
index d474688..7692eb8 100644 (file)
@@ -2886,6 +2886,10 @@ get_initial_def_for_induction (gimple iv_phi)
       gimple_assign_set_lhs (new_stmt, induc_def);
       si = gsi_start_bb (bb);
       gsi_insert_before (&si, new_stmt, GSI_SAME_STMT);
+      set_vinfo_for_stmt (new_stmt,
+                         new_stmt_vec_info (new_stmt, loop_vinfo, NULL));
+      STMT_VINFO_RELATED_STMT (vinfo_for_stmt (new_stmt))
+       = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (induction_phi));
     }
 
   return induc_def;