https://gcc.gnu.org/g:edda700714843ebc7061743bbf383d05e11ecb4a
commit r16-6648-gedda700714843ebc7061743bbf383d05e11ecb4a Author: Filip Kastl <[email protected]> Date: Fri Jan 9 15:16:50 2026 +0100 Enable -fbit-tests and -fjump-tables at -Og [PR123212] 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]> Diff: --- gcc/opts.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/opts.cc b/gcc/opts.cc index 3c59fe367abb..2b953755410b 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 },
