This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should -fcross-jumping be part of -O1?


Zack wrote:
>My suggested constellation of -O switches:
>
>-O0    No optimization whatsoever.  
>       Except maybe do obviously-dead code elimination.
>-O1    Optimize, but speed of compilation is more important than
>       speed or size of generated code.  Possibly this, not -O0,
>       should be the default mode.
>
>-O3/-Ospeed
>       Optimize for speed at the expense of size.
>-Os/-Osize
>       Optimize for size at the expense of speed.
>-O2/-Obalanced
>       Produce a balance of speed and size optimizations acceptable
>       for most code.
I must agree with these choices.  :-)

>Two factors that are *not* considered in any of these switches are
>ease of debugging, and scope (function/unit/program) of optimization.
>I do not think it is appropriate to exclude optimizations from any
>level just because they mess up debugging info,
I slightly disagree.  I think optimizations which mess up debugging info
should be excluded from -O0 always.  One of the primary purposes of "not
optimizing" is making debugging easier.  I think messing up debugging info
should be allowed for all other optimization levels, though.

> and scope of
>optimization is a detail that shouldn't be exposed at the level of
>these switches.  If it makes sense in terms of the speed/size/compile
>speed tradeoffs to do whole-program optimization at -O1 then we should
>do it at -O1.  We can have -f switches for that.
I agree.

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]