Re: Difference between -Os and -O2

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

 



Hi Hieu Le Trung,

To expand upon Georg-Johann Lay¹s recommendation, I would do this:

echo '' | gcc -fverbose-asm -Os -S -x c - -o Os.s
echo '' | gcc -fverbose-asm -O2 -S -x c - -o O2.s
vi -d Os.s O2.s

On my platform, -Os has these additional flags over -O2:

-falign-jumps-max-skip
-falign-loops-max-skip
-finline-functions

While -O2 has this flag that -Os does not have:

-ftree-ch

Those may not be the same differences on your platform, though.

HTH,
--Eljay



[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