Re: GCC 4.0.2 optimization O1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



gandhi@xxxxxxxxxx writes:

 > I have a question related to using the O1 option in gcc C to optimize the 
 > code.
 > 
 > With the compile option of -O1, my program takes 1.5 units to run.
 > 
 > However, when I compile the program with all the flags* for O1 instead of 
 > -O1 itself, my program takes 3 units to run.
 > 
 > Can anybody tell me why is this difference? Is there more to what O1 does 
 > than just turning the specified flags on?

Lots of things.  There are many places in the compiler with the phrase
"if (optimize)".  Enabling the optimization options individually
doesn't enable optimization in general.

 > I am primarily interested to know which optimizations where effective for 
 > my code.

Right, so use -O1 and turn individual optimizations *off*.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux