Inline functiion in GCC

Paul Brook paul@codesourcery.com
Fri Aug 6 22:40:00 GMT 2004


On Friday 06 August 2004 22:20, James E Wilson wrote:
> Paul Brook wrote:
> > Like most compilers, gcc generates very poor code if you don't turn
> > optimization on.
>
> But don't most compilers emit optimized code by default nowadays?  We
> would eliminate some of the questions we get if we defaulted to -O1
> instead of -O0.

I think that would get us more questions.

With -O0 it's usually obvious that the compiler isn't even trying.
With -O1 it's doing some optimization, but not much. We'll still get the "why 
does gcc generate worse code than (X)" questions. In addition we'll get more 
"why can't I debug my program properly" questions due to artifacts introduced 
by optimization. -O1 gives reasonably debuggable code, but it's definitely 
not prefect.

Paul



More information about the Gcc mailing list