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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99558
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+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
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 (); )
{
-- 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. */
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)
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);
+}
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
extern void link_error (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" } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-store_ccp" } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
extern void link_error (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" } } */
/* { 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. */
/* 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" } } */
/* { 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
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" } } */
/* { 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)
{
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" } } */
/* { 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;
};
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" } } */
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);
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