aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cfgcleanup.c8
-rw-r--r--gcc/doc/invoke.texi2
-rw-r--r--gcc/opts.c2
-rw-r--r--gcc/testsuite/gcc.dg/auto-init-uninit-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/auto-init-uninit-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/guality/example.c1
-rw-r--r--gcc/testsuite/gcc.dg/loop-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-40.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr18134.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr44547.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr59970.c2
-rw-r--r--gcc/tree-ssa-threadupdate.c2
14 files changed, 19 insertions, 14 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
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ba98eab..6d9a107 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10781,7 +10781,7 @@ so, the first branch is redirected to either the destination of the
second branch or a point immediately following it, depending on whether
the condition is known to be true or false.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fsplit-wide-types
@opindex fsplit-wide-types
diff --git a/gcc/opts.c b/gcc/opts.c
index 38b42db..6503980 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -569,6 +569,7 @@ static const struct default_options default_options_table[] =
{ OPT_LEVELS_1_PLUS, OPT_freorder_blocks, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fshrink_wrap, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fsplit_wide_types, NULL, 1 },
+ { OPT_LEVELS_1_PLUS, OPT_fthread_jumps, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_ftree_builtin_call_dce, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_ftree_ccp, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_ftree_ch, NULL, 1 },
@@ -629,7 +630,6 @@ static const struct default_options default_options_table[] =
#endif
{ OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_fstore_merging, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fthread_jumps, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_ftree_switch_conversion, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_ftree_tail_merge, NULL, 1 },
diff --git a/gcc/testsuite/gcc.dg/auto-init-uninit-1.c b/gcc/testsuite/gcc.dg/auto-init-uninit-1.c
index ce89096..502db59 100644
--- a/gcc/testsuite/gcc.dg/auto-init-uninit-1.c
+++ b/gcc/testsuite/gcc.dg/auto-init-uninit-1.c
@@ -1,5 +1,5 @@
/* Spurious uninitialized variable warnings, case 1.
Taken from cppfiles.c (merge_include_chains) */
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized -fthread-jumps -ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O -Wuninitialized -ftrivial-auto-var-init=zero" } */
#include "uninit-1.c"
diff --git a/gcc/testsuite/gcc.dg/auto-init-uninit-15.c b/gcc/testsuite/gcc.dg/auto-init-uninit-15.c
index b8f6e2b..121f0cf 100644
--- a/gcc/testsuite/gcc.dg/auto-init-uninit-15.c
+++ b/gcc/testsuite/gcc.dg/auto-init-uninit-15.c
@@ -5,7 +5,7 @@
But it is of course ok if we warn in bar about uninitialized use
of j. (not xfailed alternative) */
/* { dg-do compile } */
-/* { dg-options "-O1 -Wuninitialized -fthread-jumps -ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O1 -Wuninitialized -ftrivial-auto-var-init=zero" } */
inline int
foo (int i)
diff --git a/gcc/testsuite/gcc.dg/guality/example.c b/gcc/testsuite/gcc.dg/guality/example.c
index 37564e5..32014e2b 100644
--- a/gcc/testsuite/gcc.dg/guality/example.c
+++ b/gcc/testsuite/gcc.dg/guality/example.c
@@ -1,4 +1,5 @@
/* { dg-options "-g" } */
+/* { dg-do run { xfail { ! aarch64*-*-* } } } */
/* { dg-xfail-run-if "" aarch64*-*-* "*" { "-O[01g]" } } */
#define GUALITY_DONT_FORCE_LIVE_AFTER -1
diff --git a/gcc/testsuite/gcc.dg/loop-8.c b/gcc/testsuite/gcc.dg/loop-8.c
index e5218eb..90ea1c4 100644
--- a/gcc/testsuite/gcc.dg/loop-8.c
+++ b/gcc/testsuite/gcc.dg/loop-8.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fthread-jumps -fdump-rtl-loop2_invariant" } */
+/* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
/* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-* mmix-*-* vax-*-*" } } */
/* Load immediate on condition is available from z13 on and prevents moving
the load out of the loop, so always run this test with -march=zEC12 that
diff --git a/gcc/testsuite/gcc.dg/strlenopt-40.c b/gcc/testsuite/gcc.dg/strlenopt-40.c
index 7b79910..7a97ebb 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-40.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-40.c
@@ -1,7 +1,7 @@
/* PR tree-optimization/83671 - fix for false positive reported by
-Wstringop-overflow does not work with inlining
{ dg-do compile }
- { dg-options "-O1 -fthread-jumps -fdump-tree-optimized" } */
+ { dg-options "-O1 -fdump-tree-optimized" } */
#include "strlenopt.h"
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c
index 1b40985..8717640 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fthread-jumps -fdump-tree-optimized-blocks" } */
+/* { dg-options "-O1 -fdump-tree-optimized-blocks" } */
int c, d;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c
index d7f5d24..cd40ab2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fthread-jumps -fdump-tree-optimized" } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
int foo (int a)
{
diff --git a/gcc/testsuite/gcc.dg/uninit-1.c b/gcc/testsuite/gcc.dg/uninit-1.c
index 156d34f..060ec25 100644
--- a/gcc/testsuite/gcc.dg/uninit-1.c
+++ b/gcc/testsuite/gcc.dg/uninit-1.c
@@ -1,7 +1,7 @@
/* Spurious uninitialized variable warnings, case 1.
Taken from cppfiles.c (merge_include_chains) */
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized -fthread-jumps" } */
+/* { dg-options "-O -Wuninitialized" } */
struct list
{
diff --git a/gcc/testsuite/gcc.dg/uninit-pr44547.c b/gcc/testsuite/gcc.dg/uninit-pr44547.c
index f1c3b03..ee1035a 100644
--- a/gcc/testsuite/gcc.dg/uninit-pr44547.c
+++ b/gcc/testsuite/gcc.dg/uninit-pr44547.c
@@ -1,7 +1,7 @@
/* PR tree-optimization/44547 - -Wuninitialized reports false warning
in nested switch statements
{ dg-do compile }
- { dg-options "-O1 -Wall -fthread-jumps" } */
+ { dg-options "-O1 -Wall" } */
__attribute__ ((noipa)) int test_O1 (int argc)
{
diff --git a/gcc/testsuite/gcc.dg/uninit-pr59970.c b/gcc/testsuite/gcc.dg/uninit-pr59970.c
index d0c41b8..145af65 100644
--- a/gcc/testsuite/gcc.dg/uninit-pr59970.c
+++ b/gcc/testsuite/gcc.dg/uninit-pr59970.c
@@ -41,7 +41,7 @@ d_demangle_callback_O1 (const char *mangled)
#pragma GCC pop_options
-#pragma GCC optimize ("Og,thread-jumps")
+#pragma GCC optimize ("Og")
__attribute__ ((noipa)) int
d_demangle_callback_Og (const char *mangled)
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index cf96c90..71e602f 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -2570,7 +2570,7 @@ valid_jump_thread_path (vec<jump_thread_edge *> *path)
void
fwd_jt_path_registry::remove_jump_threads_including (edge_def *e)
{
- if (!m_paths.exists ())
+ if (!m_paths.exists () || !flag_thread_jumps)
return;
edge *slot = m_removed_edges->find_slot (e, INSERT);