Calculating elements addresses from arrays once
Gruik
gruikmusic@ifrance.com
Thu May 20 13:53:00 GMT 2004
He means use the "-O1" or "-O2" optimisation options like:
gcc -O1 foobar.c
or
gcc -O2 foobar.c
As for your original question, if you're a bit familiar
with assembly language you can readily check how well
GCC is able to optimise your code by looking at the
assembly output like so:
gcc -O2 -S foobar.c
This would create a file named "foobar.s" which by
default uses the AT&T assembler syntax - use "-masm=intel"
(on x86 boxes) to use the more popular Intel assembler
syntax, like so:
gcc -O2 -S -masm=intel foobar.c
Hope this helps,
Ranjit.
Oh okay, (i had read "Zero" instead of "O")
Thanks
And what's the drawback of using -O2 option? Only a longer compilation time?
Well i'm not really familiar with asm..
___[ Pub ]____________________________________________________________
Inscrivez-vous gratuitement sur Tandaime, Le site de rencontres !
http://rencontre.rencontres.com/index.php?origine=4
More information about the Gcc
mailing list