[Bug rtl-optimization/49477] Should have user/debugger-oriented fine-tuning of optimizations available

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 21 09:50:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49477

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.06.21 09:48:59
                 CC|                            |hubicka at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-21 09:48:59 UTC ---
Confirmed.

We should

 1) disable unneeded optimization at -O0 (we do a lot of folding)
 2) look at -O1 (it's basically "untuned" for the last years), make
    it the intended "reasonable optimization with good compile-time
    and debugging experience" again.

For -O1 my idea was to simply _only_ do early optimizations, thus drop
any IPA optimizations from it and not execute pass_all_optimizations.
In addition to that from early optimizations disable
pass_sra_early, pass_early_ipa_sra and pass_convert_switch.  Eventually
insert a DSE pass early (not really sure).

It'll of course change fundamentally what code we emit for -O1, but at
least we have strong CSE/DCE passes and early inlining that is able
to remove C++ abstraction.

Patch that will arrive there half-way (eventually needs fixing so we
still handle some special builtins):

Index: gcc/tree-optimize.c
===================================================================
--- gcc/tree-optimize.c (revision 175205)
+++ gcc/tree-optimize.c (working copy)
@@ -53,7 +53,7 @@ along with GCC; see the file COPYING3.
 static bool
 gate_all_optimizations (void)
 {
-  return (optimize >= 1
+  return (optimize > 1
          /* Don't bother doing anything if the program has errors.
             We have to pass down the queue if we already went into SSA */
          && (!seen_error () || gimple_in_ssa_p (cfun)));



More information about the Gcc-bugs mailing list