LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   GCC optimizations: What does -O4 do? (https://www.linuxquestions.org/questions/linux-software-2/gcc-optimizations-what-does-o4-do-459544/)

Daws 06-29-2006 02:59 PM

GCC optimizations: What does -O4 do?
 
I compiled mplayer svn recently and noticed that it used the -O4 flag. I was under the impression that -O3 was the highest gcc would go. I read through the gcc manual and there is no mention -O4. Well I was just wondering if anyone knew what it does, specifically what it does that -O3 does not do?

ilikejam 06-29-2006 03:26 PM

Hmmm. There's definitely no -O4 listed in the docs.
http://gcc.gnu.org/onlinedocs/gcc/Op...timize-Options

I've just tried it with a small app of my own, and the executable created is exactly the same size as with -O3. I'd imagine it does the same thing.

Odd though.

Dave

Hammett 06-29-2006 06:28 PM

You can use -Os to get smaller binaries....I have checked it and haven't found any improvements though

Daws 06-29-2006 07:19 PM

Quote:

You can use -Os to get smaller binaries....I have checked it and haven't found any improvements though
I hear from the gentoo folks that this is very effective for firefox, haven't tried it myself, I quite like konqueror.

Daws 06-30-2006 12:13 PM

Well I found the answer if anyone is interested. -O4 at the moment is the same as -O3, -O4 is for further optimisations that may be introduced in future versions of gcc. Mplayer uses them just in case they are actually introduced (you know what their release cycle is like).

I was hoping the answer would be more interesting than that. Oh well.

daihard 06-30-2006 12:46 PM

Quote:

Originally Posted by Daws
I hear from the gentoo folks that this is very effective for firefox, haven't tried it myself, I quite like konqueror.

As far as I know, -Os is what Fedora uses as the standard optimization flag for its Firefox RPM.


All times are GMT -5. The time now is 06:15 PM.