tree-optimize.c (init_tree_optimization_passes): Re-organize optimization passes...
authorDiego Novillo <dnovillo@redhat.com>
Wed, 11 May 2005 02:24:44 +0000 (02:24 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Wed, 11 May 2005 02:24:44 +0000 (22:24 -0400)
* tree-optimize.c (init_tree_optimization_passes): Re-organize
optimization passes to do an initial batch of scalar cleanups.

testsuite/ChangeLog

* gcc.dg/pr18501.c: XFAIL.
* gcc.dg/tree-ssa/loop-4.c: Fix expected pattern.
* gcc.dg/tree-ssa/pr20913.c: Change to link-time test.
* gcc.dg/tree-ssa/ssa-ccp-2.c: Change to a .optimized scan.
* gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise.
* gcc.dg/tree-ssa/ssa-dom-ccp-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-7.c: Change to a .fre scan.
* gcc.dg/tree-ssa/ssa-pre-8.c: Likewise.

From-SVN: r99558

12 files changed:
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr18501.c
gcc/testsuite/gcc.dg/tree-ssa/loop-4.c
gcc/testsuite/gcc.dg/tree-ssa/pr20913.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-ccp-1.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c
gcc/tree-optimize.c

index 8a1827fc99dd1dbb6ba69a206215d923f6457fce..cda2fc7dbf44a3f60c8847d8bf323d54b820c654 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-10  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-optimize.c (init_tree_optimization_passes): Re-organize
+       optimization passes to do an initial batch of scalar cleanups.
+
 2005-05-10  Ian Lance Taylor  <ian@airs.com>
 
        * read-rtl.c (struct macro_traverse_data): Define.
index 199e9ab98d246b2d808126adc37e4791b2dad839..8e73d94f7975f4255790c295ae4948b2ce27e9d2 100644 (file)
@@ -1,3 +1,15 @@
+2005-05-10  Diego Novillo  <dnovillo@redhat.com>
+
+       * gcc.dg/pr18501.c: XFAIL.
+       * gcc.dg/tree-ssa/loop-4.c: Fix expected pattern.
+       * gcc.dg/tree-ssa/pr20913.c: Change to link-time test.
+       * gcc.dg/tree-ssa/ssa-ccp-2.c: Change to a .optimized scan.
+       * gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise.
+       * gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise.
+       * gcc.dg/tree-ssa/ssa-dom-ccp-1.c: Likewise.
+       * gcc.dg/tree-ssa/ssa-pre-7.c: Change to a .fre scan.
+       * gcc.dg/tree-ssa/ssa-pre-8.c: Likewise.
+
 2005-05-10  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR fortran/20178
index bcd20717f9e7c2821de51ad43f506128daef9096..8794486eea8242c3506ebb50e99a7ccd484359ee 100644 (file)
@@ -9,7 +9,7 @@ int something (void);
 void
 bitmap_print_value_set (void)
 {
-  unsigned first;      /* { dg-warning "may be used" "conditional in loop" } */
+  unsigned first;      /* { dg-warning "may be used" "conditional in loop" { xfail *-*-* } } */
   
   for (; bmp_iter_set (); )
     {
index 147a343eff0d97d47a8a690636680459a7522b1f..6a6b97d9925feb47ddcb1c6d185e72d8727210d9 100644 (file)
@@ -32,9 +32,9 @@ void xxx(void)
    -- induction variable with base 0, the memory access of form
       *(iv + &arr_base[0].y) = ...
 
-   In any case, we should not have 'arr_base.[^0].* ='  */
+   In any case, we should not have 'arr_base[.*] ='  */
 
-/* { dg-final { scan-tree-dump-times "arr_base.\[^0\]\[^\\n\\r\]*=" 0 "vars" } } */
+/* { dg-final { scan-tree-dump-times "arr_base\[.*\]\.y =" 0 "vars" } } */
 
 /* And the original induction variable should be eliminated.  */
 
index 43abc81c81c875f27448c444117c20ad7fa516a5..fb5461a26092ff493c7dd32e2c547327a398c46f 100644 (file)
@@ -2,8 +2,8 @@
    COPY-PROP did not fold COND_EXPR, blocking some copy propagation
    opportunities.  */
 
-/* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-copyprop1-details" } */
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-tree-dominator-opts" } */
 
 int
 foo (int a, int b, int c, int d)
@@ -14,13 +14,21 @@ foo (int a, int b, int c, int d)
   if (a == b)
     x = c;
   else
-    x = d;
+    {
+      link_error ();
+      x = d;
+    }
 
   if (x == c)
     return a;
   else
-    return b;
+    {
+      link_error ();
+      return b;
+    }
 }
 
-/* { dg-final { scan-tree-dump-times "with if \\(1\\)" 2 "copyprop1"} } */
-/* { dg-final { cleanup-tree-dump "copyprop1" } } */
+main()
+{
+  foo (1, 2, 3, 4);
+}
index 4c7e36a8f9e1cd8b78cf90dc6492708a361d7688..19975a39215163690408a8ea4cd01c03347934c3 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
 
 extern void link_error (void);
 
@@ -168,5 +168,5 @@ int test99999 (void)
 
 /* There should be not link_error calls, if there is any the
    optimization has failed */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp"} } */
-/* { dg-final { cleanup-tree-dump "store_ccp" } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index 3898ce6fa7ab873d577d9e379edd4d87713969a4..b3497413064f6a6fa8d6abe56cd5aef001e9a93b 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-store_ccp" } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
 
 extern void link_error (void);
 
@@ -23,5 +23,5 @@ int test7 (int a)
 
 /* There should be not link_error calls, if there is any the
    optimization has failed */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp"} } */
-/* { dg-final { cleanup-tree-dump "store_ccp" } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index d9b41e6059a8fc3b07c22170df62a5971f3bdbf1..af23f8bebd962973fcd7590ddd0f20b6379ebef1 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-store_ccp" } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
 
 /* Check that cprop works for assignments to array elements and structs.  */
 
@@ -51,5 +51,5 @@ test99999 (int *arr, int j)
 
 /* There should be no link_error calls, if there is any, the
    optimization has failed */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp"} } */
-/* { dg-final { cleanup-tree-dump "store_ccp" } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index 9aacbcb27466ddce0b257d3e2c76b9d1c2bf3792..b2bcd06bedbda3134099cb6e6d0d65fa4e509db3 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-dom1-details" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
 int t(int a) __attribute__ ((const));
 void abort (void);
 int
@@ -14,5 +14,5 @@ ccp(int b)
        return a;
 }
 /* We should propagate constant 4 into return.  */
-/* { dg-final { scan-tree-dump-times "Replaced.*with constant '4'" 1 "dom1"} } */
-/* { dg-final { cleanup-tree-dump "dom1" } } */
+/* { dg-final { scan-tree-dump-times "return 4" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index 642c36cbf8c320a87e3853643e846bf3a2778f49..c87f62e69c6775cb1db43b290daffc7d3e5f7c07 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-pre-stats" } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */
 int
 foo (int *array)
 {
@@ -8,5 +8,5 @@ foo (int *array)
       return 0;
 }
 /* We should eliminate one address calculation, and one load.  */
-/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre"} } */
-/* { dg-final { cleanup-tree-dump "pre" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "fre"} } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
index 2f6393cf16dfe23195ce75802c3fe9fd4e4d064d..a6535fb4013e2cbebba9a5f13ac9702884fc1d90 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-pre-stats" } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */
 struct s {
       int *n;
 };
@@ -17,5 +17,5 @@ foo (__SIZE_TYPE__ i, struct s *array)
   return 0;
 }
 /* We should eliminate two address calculations, one cast, and one load.  */
-/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre"} } */
-/* { dg-final { cleanup-tree-dump "pre" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "fre"} } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
index 6b1d35554f4fa8686636fcf3c4b55eb4e45f1ee7..6e07a2b504f55d13b77055e49a9bf4d250ccd644 100644 (file)
@@ -364,12 +364,17 @@ init_tree_optimization_passes (void)
   NEXT_PASS (pass_may_alias);
   NEXT_PASS (pass_rename_ssa_copies);
   NEXT_PASS (pass_early_warn_uninitialized);
-  NEXT_PASS (pass_dce);
-  NEXT_PASS (pass_dominator);
-  NEXT_PASS (pass_copy_prop);
+
+  /* Initial scalar cleanups.  */
+  NEXT_PASS (pass_ccp);
+  NEXT_PASS (pass_fre);
   NEXT_PASS (pass_dce);
   NEXT_PASS (pass_forwprop);
   NEXT_PASS (pass_vrp);
+  NEXT_PASS (pass_copy_prop);
+  NEXT_PASS (pass_dce);
+  NEXT_PASS (pass_dominator);
+
   NEXT_PASS (pass_merge_phi);
   NEXT_PASS (pass_phiopt);
   NEXT_PASS (pass_may_alias);
@@ -403,6 +408,7 @@ init_tree_optimization_passes (void)
   NEXT_PASS (pass_loop);
   NEXT_PASS (pass_dominator);
   NEXT_PASS (pass_copy_prop);
+  NEXT_PASS (pass_dce);
   /* FIXME: If DCE is not run before checking for uninitialized uses,
      we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
      However, this also causes us to misdiagnose cases that should be