Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::lockfree::queue not working with -fgnu-tm
From: Ben Pope (benpope81_at_[hidden])
Date: 2014-07-16 11:46:49


On Wednesday, July 16, 2014 09:37 PM, Angelo Mondaini wrote:
> Yes, same here!
> As far as I know, "-O3" or "-O2" tries to optimize the memory usage and
> binary size.
> However, "-fgnu-tm" also deals with the memory, so, this seems like
> compatibility problem with both flags.
> Note that gcc manual for "-fgnu-tm" says: "This is an experimental
> feature ...".
> And "-O3" flag includes very aggressive optimizations, sometimes it can
> fail by it own.
> I think a bug report would be a good option...

According to the docs:

-O2 is "full optimisation"
-O3 is "full optimisation with more aggressive inlining and vectorisation"

That's a strange description that's possibly no longer true.

I don't think either of them optimise for memory or binary size, more
for speed (specifically at the expense of binary and memory size).

I also don't think either of them "fail by its own", modulo compiler bugs.

This idea that high optimisation levels produce incorrect code is
strange to me. From what I've seen, aggressive optimisations are more
likely to highlight undefined behaviour, but code that relies on
undefined behaviour is broken code. The compiler doesn't break correct
code, it trusts what you tell it.

So please, can we stop the FUD and just get on with a fix; either in the
library or the compiler, for technical or practical reasons.

Ben


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net