PR tree-optimization/36630
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Sep 2008 10:05:37 +0000 (10:05 +0000)
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Sep 2008 10:05:37 +0000 (10:05 +0000)
* tree-vect-transform.c (vect_update_ivs_after_vectorizer):
Call STRIP_NOPS before calling evolution_part_in_loop_num.

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

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

index 5520820..69d99be 100644 (file)
@@ -1,3 +1,10 @@
+2008-09-07  Richard Guenther  <rguenther@suse.de>
+            Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/36630
+       * tree-vect-transform.c (vect_update_ivs_after_vectorizer):
+       Call STRIP_NOPS before calling evolution_part_in_loop_num.
+
 2008-09-07  Dorit Nuzman  <dorit@il.ibm.com>
             Ira Rosen  <irar@il.ibm.com>
 
index 7d83cbb..b05e0c7 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-07  Richard Guenther  <rguenther@suse.de>
+            Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/36630
+       * gcc.dg/vect/pr36630.c: New test.
+
 2008-09-07  Daniel Kraft  <d@domob.eu>
 
        * gfortran.dg/stfunc_6.f90: Extended testcase to include more tests
diff --git a/gcc/testsuite/gcc.dg/vect/pr36630.c b/gcc/testsuite/gcc.dg/vect/pr36630.c
new file mode 100644 (file)
index 0000000..9d85aff
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void
+foo (unsigned char *x, short y)
+{
+  short i;
+
+  i = 2;
+  while (i < y)
+    {
+      x[i - 1] = x[i];
+      i = i + 1;
+    }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
index 3a77c5b..17f3217 100644 (file)
@@ -7332,6 +7332,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
 
       access_fn = analyze_scalar_evolution (loop, PHI_RESULT (phi)); 
       gcc_assert (access_fn);
+      STRIP_NOPS (access_fn);
       evolution_part =
         unshare_expr (evolution_part_in_loop_num (access_fn, loop->num));
       gcc_assert (evolution_part != NULL_TREE);