aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.def
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-11-10 15:04:10 +0100
committerRichard Biener <rguenther@suse.de>2022-11-11 14:31:24 +0100
commitbe2c74fdcd0e8d66c3667008ba2561ab5dcc379b (patch)
tree091155704143fbac78105c27630499db30634b80 /gcc/passes.def
parent3b54cc9d04c2efb2c8f9a0b515e638917636630c (diff)
downloadgcc-be2c74fdcd0e8d66c3667008ba2561ab5dcc379b.zip
gcc-be2c74fdcd0e8d66c3667008ba2561ab5dcc379b.tar.gz
gcc-be2c74fdcd0e8d66c3667008ba2561ab5dcc379b.tar.bz2
Make last DCE remove empty loops
The following makes the last DCE pass CD-DCE and in turn the last CD-DCE pass a DCE one. That ensues we remove empty loops that become empty between the two. I've also moved the tail-call pass after DCE since DCE can only improve things here. The two testcases were the only ones scanning cddce3 so I've changed them to scan the dce7 pass that's now in this place. The testcases scanning dce7 also work when that's in the earlier position. PR tree-optimization/84646 * tree-ssa-dce.cc (pass_dce::set_pass_param): Add param wheter to run update-address-taken. (pass_dce::execute): Honor it. * passes.def: Exchange last DCE and CD-DCE invocations. Swap pass_tail_calls and the last DCE. * g++.dg/tree-ssa/pr106922.C: Continue to scan earlier DCE dump. * gcc.dg/tree-ssa/20030808-1.c: Likewise.
Diffstat (limited to 'gcc/passes.def')
-rw-r--r--gcc/passes.def8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/passes.def b/gcc/passes.def
index 193b579..462e9af 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -346,8 +346,8 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ccp, true /* nonzero_p */);
NEXT_PASS (pass_warn_restrict);
NEXT_PASS (pass_dse);
- NEXT_PASS (pass_cd_dce, true /* update_address_taken_p */);
- /* After late CD DCE we rewrite no longer addressed locals into SSA
+ NEXT_PASS (pass_dce, true /* update_address_taken_p */);
+ /* After late DCE we rewrite no longer addressed locals into SSA
form if possible. */
NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_sink_code, true /* unsplit edges */);
@@ -355,12 +355,12 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_fold_builtins);
NEXT_PASS (pass_optimize_widening_mul);
NEXT_PASS (pass_store_merging);
- NEXT_PASS (pass_tail_calls);
/* 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
real warnings (e.g., testsuite/gcc.dg/pr18501.c). */
- NEXT_PASS (pass_dce);
+ NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */);
+ NEXT_PASS (pass_tail_calls);
/* Split critical edges before late uninit warning to reduce the
number of false positives from it. */
NEXT_PASS (pass_split_crit_edges);