|
Boost Users : |
Subject: Re: [Boost-users] boost::lockfree::queue not working with -fgnu-tm
From: Angelo Mondaini (oangelo_at_[hidden])
Date: 2014-07-16 09:37:35
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...
HTH,
Angelo
2014-07-16 6:22 GMT-03:00 Philipp Schoppe <philipp.schoppe_at_[hidden]>:
> The problem seems to be the combination of -fgnu-tm and any -O flag.
> It doesn't compile for -O1 or -O2, as well. -O0 works. Can you confirm
> that? Has anybody ever experienced this before and knows a workaround?
> Maybe I should open a bug report.
>
>
> On 07/15/2014 11:47 PM, Angelo Mondaini wrote:
>
>> I also use Archlinux, I have tested your code.
>> Indeed, with all the flags you are trying, gcc can't compile.
>> To me, the problem is the flag "-O3", removing it gcc can compile the
>> code, no problem.
>> Note that "-O3" are very wild optimizations, it can makes the code slower
>> some times and it can even break the code.
>> Careful when using it.
>>
>> HTH,
>> Angelo
>>
>>
>> 2014-07-15 12:09 GMT-03:00 Philipp Schoppe <philipp.schoppe_at_[hidden]
>> <mailto:philipp.schoppe_at_[hidden]>>:
>>
>>
>> Hello,
>>
>> I try to benchmark different queue implementations. I have a test
>> program
>> which includes the boost lockfree queue and some custom
>> implementations
>> where one is using gcc's STM. In order to compile it, I need to
>> add the -fgnu-tm
>> flag. I am using an up-to-date arch linux system with gcc 4.9.0
>> and boost 1.55.0
>> When adding this flag, I get a compilation error. This is a small
>> example that
>> illustrates the problem:
>>
>> errtest.cpp:
>>
>> #include <boost/lockfree/queue.hpp>
>>
>> int main () {
>>
>> boost::lockfree::queue<int> lfqueue;
>> lfqueue.push(234);
>>
>> return 0;
>> }
>>
>> Compiling it using
>>
>> g++ -std=c++11 -lboost_system -g -O3 -Wall -Werror -Wswitch-enum
>> -fgnu-tm errtest.cpp -o test
>>
>> leads to an error.
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden] <mailto:Boost-users_at_[hidden]>
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
>>
>>
>>
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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