Boost logo

Boost-Build :

Subject: Re: [Boost-build] Choice of optimization flags for GCC
From: Jim Talbut (jtalbut_at_[hidden])
Date: 2008-09-09 01:42:40

We have found -O3 to be unreliable - specifically I think it was
-funroll-loops that caused boost::program_options to crash for us.

There are obviously way too many other factors involved here for me to
simply say that it doesn't work, but it was enough for us to avoid -O3.


> -----Original Message-----
> From: boost-build-bounces_at_[hidden] [mailto:boost-build-
> bounces_at_[hidden]] On Behalf Of Vladimir Prus
> Sent: 08 September 2008 22:06
> To: Boost.Build developer's and user's list
> Subject: Re: [Boost-build] Choice of optimization flags for GCC
> On Monday 08 September 2008 22:51:11 David Abrahams wrote:
> >
> > According to, we
> are
> > using suboptimal optimization settings when building on GCC-4.x (-O3;
> > they say it should be -O2). I seem to recall hearing from someone
> (who
> > ought to know) that -O3 was actually strictly experimental and not
> even
> > guaranteed to produce correct code. But I may be misremembering and
> I
> > am unable to corroborate any of this. Anyone?
> FWIW, CodeSourcery's support recommends -O2, because -O3 was found not
> to
> be uniformly better than -O2. But we're on thin ice here -- benchmarks
> results are valid for a specific compiler version, with specific vendor
> patches and configuration so that recommendation may be right for our
> specific release, but not necessary right for every random gcc in the
> wild.
> If a user really care for performance, he can experiement with
> specific flags, adding them via cxxflags feature. Say, gcc benchmarks
> on
> use contrived flags, like, for example:
> -O3 -funroll-loops -fpeel-loops -ffast-math
> - Volodya
> _______________________________________________
> Unsubscribe & other changes:

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at