Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-07-11 07:59:16


On Wednesday 11 July 2007 15:32, Jos Hickson wrote:
> [snip]
> >
> > > One thing I was wonder was why -O3 is the default as that is usually
> > > considered a bit risky?
> >
> > Is it? I'm not aware of that.
> >
>
> To quote from the Gentoo Linux "Safe CFLAGS" page
> (http://gentoo-wiki.com/Safe_Cflags) as an example:
>
> <quote>
> Note that -O2 is regarded as safer than "-O3", and "-O3" can often be
> a counter-productive attempt at optimization.
> </quote>

To quote from gcc manual:
http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Optimize-Options.html#Optimize-Options

        -O3
        Optimize yet more. -O3 turns on all optimizations specified by
        -O2 and also turns on the -finline-functions,
        -funswitch-loops and -fgcse-after-reload options.

Nothing here say that -03 enables any risky optimization.

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk