This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Gcc optimization flags
- From: "Long Fei" <lfei at ecn dot purdue dot edu>
- To: <gcc at gcc dot gnu dot org>, <gcc at gnu dot org>
- Date: Tue, 5 Aug 2003 21:31:10 -0500
- Subject: Gcc optimization flags
It seems that without turning on the -O flag, other optimization flags
won't have any effect ?
Did anybody have any experience in using the flags separately rather
than -Ox ?
If I want to run a single optimization, for instance, unroll-loops, how
can I do without -O (and thus bringing in -fdefer-pop,
-fmerge-constants, -fthread-jumps, -floop-optimize, -fcrossjumping,
-fif-conversion, -fif-conversion2, -fdelayed-branch,
-fguess-branch-probability, -fcprop-registers) which may "pollute" the
result ?
I had a simple test. The results of the following two compilations are
different:
gcc -O foo.c
gcc -fdefer-pop -fmerge-constants -fthread-jumps -floop-optimize
-fcrossjumping -fif-conversion -fif-conversion2 -fdelayed-branch
-fguess-branch-probability -fcprop-registers foo.c
While -O should be equivalent to "-fdefer-pop -fmerge-constants
-fthread-jumps -floop-optimize -fcrossjumping -fif-conversion
-fif-conversion2 -fdelayed-branch -fguess-branch-probability
-fcprop-registers".
Can anybody (expert/insider) give a detailed explanation ?
Thanks a lot,