https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123212

--- Comment #6 from Filip Kastl <pheeck at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> I don't see why you throw -O0 into the same bucket as -Og.
> For -O0 compile time is really important.  For -Og, the debuggability of code 
> is much more important, not really short compile time

Ah, ok!  I probably assumed that fast edit-compile-run cycle is similarly
important as debuggability.

Well then bit tests and jump tables should never have been disabled on -Og, it
seems to me.  Let's do this then:

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 },

Reply via email to