Follow up to the discussion in pr123212. Should I commit this once I regstrap
it?
Filip Kastl
--- 8< ---
Since GCC 15, bit test and jump table lowering was disabled for both -O0
and -Og to save compile time. On -Og, compile time isn't *that*
critical, so this patch enables bit tests and jump tables on -Og once
again.
PR c/123212
gcc/ChangeLog:
* opts.cc: Enable -fbit-tests and -fjump-tables at -Og.
Signed-off-by: Filip Kastl <[email protected]>
---
gcc/opts.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 3c59fe367ab..2b953755410 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -586,6 +586,7 @@ maybe_default_options (struct gcc_options *opts,
static const struct default_options default_options_table[] =
{
/* -O1 and -Og optimizations. */
+ { OPT_LEVELS_1_PLUS, OPT_fbit_tests, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fcombine_stack_adjustments, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fcompare_elim, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fcprop_registers, NULL, 1 },
@@ -596,6 +597,7 @@ static const struct default_options default_options_table[]
=
{ OPT_LEVELS_1_PLUS, OPT_fipa_pure_const, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fipa_reference, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fipa_reference_addressable, NULL, 1 },
+ { OPT_LEVELS_1_PLUS, OPT_fjump_tables, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fmerge_constants, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_freorder_blocks, NULL, 1 },
@@ -616,7 +618,6 @@ static const struct default_options default_options_table[]
=
{ OPT_LEVELS_1_PLUS, OPT_fvar_tracking, NULL, 1 },
/* -O1 (and not -Og) optimizations. */
- { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbit_tests, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbranch_count_reg, NULL, 1 },
#if DELAY_SLOTS
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fdelayed_branch, NULL, 1 },
@@ -625,7 +626,6 @@ static const struct default_options default_options_table[]
=
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fif_conversion, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fif_conversion2, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_finline_functions_called_once, NULL, 1
},
- { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fjump_tables, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_invariants, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_stores, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fssa_phiopt, NULL, 1 },
--
2.51.0