Fix PR32824.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 2010 19:19:41 +0000 (19:19 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 2010 19:19:41 +0000 (19:19 +0000)
2010-04-06  Changpeng Fang  <changpeng.fang@amd.com>

PR middle-end/32824
* passes.c (init_optimization_passes): Move pass_lim before
pass_copy_prop and pass_dce_loop.

* gcc.dg/vect/pr32824: New.

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

gcc/ChangeLog
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr32824.c [new file with mode: 0644]

index 0d1fc70..7e98243 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-06  Changpeng Fang  <changpeng.fang@amd.com>
+
+       PR middle-end/32824
+       * passes.c (init_optimization_passes): Move pass_lim before
+       pass_copy_prop and pass_dce_loop.
+
 2010-04-06  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/43667
index 33d52af..8791ebc 100644 (file)
@@ -885,9 +885,9 @@ init_optimization_passes (void)
        {
          struct opt_pass **p = &pass_tree_loop.pass.sub;
          NEXT_PASS (pass_tree_loop_init);
+         NEXT_PASS (pass_lim);
          NEXT_PASS (pass_copy_prop);
          NEXT_PASS (pass_dce_loop);
-         NEXT_PASS (pass_lim);
          NEXT_PASS (pass_tree_unswitch);
          NEXT_PASS (pass_scev_cprop);
          NEXT_PASS (pass_record_bounds);
index a485fcb..5127b32 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-06  Changpeng Fang  <changpeng.fang@amd.com>
+
+       PR middle-end/32824
+       * gcc.dg/vect/pr32824: New.
+
 2010-04-06  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/18918
diff --git a/gcc/testsuite/gcc.dg/vect/pr32824.c b/gcc/testsuite/gcc.dg/vect/pr32824.c
new file mode 100644 (file)
index 0000000..8f36d1d
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a[16*100];
+int e;
+void foo(void)
+{
+  int i;
+  for(i = 0;i<16*100;i++)
+    e += a[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+