tree-optimize.c (init_tree_optimization_passes): Re-organize optimization passes to do an initial batch of scalar cleanups.

* 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
This commit is contained in:
Diego Novillo 2005-05-11 02:24:44 +00:00 committed by Diego Novillo
parent bd7d50f8b1
commit 9a8cb141dc
12 changed files with 61 additions and 30 deletions

View 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.

View 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

View 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 (); )
{

View 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. */

View 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);
}

View 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" } } */

View 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" } } */

View 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" } } */

View 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" } } */

View 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" } } */

View 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" } } */

View 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