This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: list of optimizations done by -O1 level
- From: John Love-Jensen <eljay at adobe dot com>
- To: ranjith kumar <ranjit_kumar_b4u at yahoo dot co dot uk>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 22 Feb 2007 11:16:38 -0600
- Subject: 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