diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-09-28 11:33:11 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-09-28 14:33:53 +0200 |
commit | c32f7df917b01c3636aa85916a36264e807ced9d (patch) | |
tree | 680f004535a2324387441a02202348bd9ae3323c /gcc/cfgcleanup.c | |
parent | 95540a6d1d7b29cdd3ed06fbcb07465804504cfd (diff) | |
download | gcc-c32f7df917b01c3636aa85916a36264e807ced9d.zip gcc-c32f7df917b01c3636aa85916a36264e807ced9d.tar.gz gcc-c32f7df917b01c3636aa85916a36264e807ced9d.tar.bz2 |
Enable jump threading at -O1.
My previous patch gating all jump threading by -fthread-jumps had the
side effect of turning off DOM jump threading at -O1. This causes
numerous -Wuninitialized false positives. This patch turns on jump
threading at -O1 to minimize the disruption.
gcc/ChangeLog:
* cfgcleanup.c (pass_jump::execute): Check
flag_expensive_optimizations.
(pass_jump_after_combine::gate): Same.
* doc/invoke.texi (-fthread-jumps): Enable for -O1.
* opts.c (default_options_table): Enable -fthread-jumps at -O1.
* tree-ssa-threadupdate.c
(fwd_jt_path_registry::remove_jump_threads_including): Bail unless
flag_thread_jumps.
gcc/testsuite/ChangeLog:
* gcc.dg/auto-init-uninit-1.c: Adjust.
* 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/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 7b1e1ba..82fc505 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -3239,7 +3239,8 @@ pass_jump::execute (function *) if (dump_file) dump_flow_info (dump_file, dump_flags); cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) - | (flag_thread_jumps ? CLEANUP_THREADING : 0)); + | (flag_thread_jumps && flag_expensive_optimizations + ? CLEANUP_THREADING : 0)); return 0; } @@ -3274,7 +3275,10 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_thread_jumps; } + virtual bool gate (function *) + { + return flag_thread_jumps && flag_expensive_optimizations; + } virtual unsigned int execute (function *); }; // class pass_jump_after_combine |