]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Enable -fbit-tests and -fjump-tables at -Og [PR123212]
authorFilip Kastl <fkastl@suse.cz>
Fri, 9 Jan 2026 14:16:50 +0000 (15:16 +0100)
committerFilip Kastl <fkastl@suse.cz>
Fri, 9 Jan 2026 14:16:50 +0000 (15:16 +0100)
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 <fkastl@suse.cz>
gcc/opts.cc

index 3c59fe367abb843d215352b8568a6641b0f932f7..2b953755410bffde24a6b9687251cc1827904248 100644 (file)
@@ -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 },