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 Weinberg writes:

>>> -O0    No optimization whatsoever.  
>>> Except maybe do obviously-dead code elimination.
>> 
>> This is obviously a very special case, but dead code elimination
>> sometimes makes it difficult to write tests for GDB's test suite.  And
>> even when working on real programs I occasionally insert dead code as
>> a place where I can set breakpoints.  So, personally, I'd prefer that
>> -O0 be pretty stupid.  (Though I don't mind if it's not the default.)

Zack> That's a good point.  We seem to be trending in the direction of
Zack> having -O0 do a little bit of optimization, not much, is the main
Zack> reason I threw that in.

Zack> I think I meant unreachable code, not dead code; does that change your
Zack> opinion?

	Users normally want a fast write-compile-debug cycle at -O0.
Performing some minimal optimizations removing useless code reduces the
number of instructions that the compiler needs to process -- even writing
out the file -- which speeds up the compilation.  Most proprietary
compilers perform some optimization at -O0.  If you really want an
optimization level that doesn't touch the code at all, probably at the
expense of even slower compilation speed, add another level below -O0.

David


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