diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-09-27 16:41:01 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-09-28 08:17:29 +0200 |
commit | e475ae9bbf0c85a7d60f236c5a744e163a9ef7b8 (patch) | |
tree | edf942bb62820aa08cba690bfa55461e4397699b /gcc/tree-ssa-threadbackward.c | |
parent | 9cfb95f9b92326e86e99b50350ebf04fa9cd2477 (diff) | |
download | gcc-e475ae9bbf0c85a7d60f236c5a744e163a9ef7b8.zip gcc-e475ae9bbf0c85a7d60f236c5a744e163a9ef7b8.tar.gz gcc-e475ae9bbf0c85a7d60f236c5a744e163a9ef7b8.tar.bz2 |
Control all jump threading passes with -fjump-threads.
Last year I mentioned that -fthread-jumps was being ignored by the
majority of our jump threading passes, and Jeff said he'd be in favor
of fixing this.
This patch remedies the situation, but it does change existing behavior.
Currently -fthread-jumps is only enabled for -O2, -O3, and -Os. This
means that even if we restricted all jump threading passes with
-fthread-jumps, DOM jump threading would still seep through since it
runs at -O1.
I propose this patch, but it does mean that DOM jump threading would
have to be explicitly enabled with -O1 -fthread-jumps.
gcc/ChangeLog:
* tree-ssa-threadbackward.c (pass_thread_jumps::gate): Check
flag_thread_jumps.
(pass_early_thread_jumps::gate): Same.
* tree-ssa-threadedge.c (jump_threader::thread_outgoing_edges):
Return if !flag_thread_jumps.
* tree-ssa-threadupdate.c
(jt_path_registry::register_jump_thread): Assert that
flag_thread_jumps is true.
gcc/testsuite/ChangeLog:
* gcc.dg/auto-init-uninit-1.c: Add -fthread-jumps.
* gcc.dg/auto-init-uninit-15.c: Same.
* gcc.dg/guality/example.c: Same.
* gcc.dg/loop-8.c: Same.
* gcc.dg/strlenopt-40.c: Same.
* gcc.dg/tree-ssa/pr18133-2.c: Same.
* gcc.dg/tree-ssa/pr18134.c: Same.
* gcc.dg/uninit-1.c: Same.
* gcc.dg/uninit-pr44547.c: Same.
* gcc.dg/uninit-pr59970.c: Same.
Diffstat (limited to 'gcc/tree-ssa-threadbackward.c')
-rw-r--r-- | gcc/tree-ssa-threadbackward.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c index e6819fe..28c7ef8 100644 --- a/gcc/tree-ssa-threadbackward.c +++ b/gcc/tree-ssa-threadbackward.c @@ -943,7 +943,7 @@ public: bool pass_thread_jumps::gate (function *fun ATTRIBUTE_UNUSED) { - return flag_expensive_optimizations; + return flag_thread_jumps && flag_expensive_optimizations; } // Try to thread blocks in FUN. Return TRUE if any jump thread paths were @@ -1013,7 +1013,7 @@ public: bool pass_early_thread_jumps::gate (function *fun ATTRIBUTE_UNUSED) { - return true; + return flag_thread_jumps; } unsigned int |