This is the mail archive of the gcc-help@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: list of optimizations done by -O1 level


Hi Ranjith,

I don't have an answer to your inquiry, but here's a helpful trick to answer
the "Hmmm, I wonder what flags are controlled by the optimization level
flags?" ...

echo '' | g++     -fverbose-asm -S -x c++ - -o blank.s
echo '' | g++ -O0 -fverbose-asm -S -x c++ - -o O0.s
echo '' | g++ -O1 -fverbose-asm -S -x c++ - -o O1.s
echo '' | g++ -O2 -fverbose-asm -S -x c++ - -o O2.s
echo '' | g++ -O3 -fverbose-asm -S -x c++ - -o O3.s
echo '' | g++ -Os -fverbose-asm -S -x c++ - -o Os.s

Note: there are optimizations above-and-beyond the ones that are
identifiable by a specific named flag.

HTH,
--Eljay



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