Subject: [Boost-bugs] [Boost C++ Libraries] #10204: boost::lockfree:queue: g++ -fgnu-tm and -O1/2/3 flag not working
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-16 10:59:28
#10204: boost::lockfree:queue: g++ -fgnu-tm and -O1/2/3 flag not working
-------------------------------------------------+-------------------------
Reporter: philipp.schoppe@⦠| Owner:
Type: Bugs | timblechmann
Milestone: To Be Determined | Status: new
Version: Boost 1.55.0 | Component: lockfree
Keywords: -fgnu-tm -O compiler flag | Severity: Problem
combination |
-------------------------------------------------+-------------------------
The combination of g++ -fgnu-tm and optimization flags do not work
when when using boost::lockfree::queue.
{{{
#include <boost/lockfree/queue.hpp>
int main () {
boost::lockfree::queue<int> lfqueue;
lfqueue.push(234);
return 0;
}
}}}
Compiling it using
{{{
g++ -std=c++11 -g -Wall -Werror -lboost_system -fgnu-tm
}}}
works. Adding -O1 / -O2 / -O3 leads to the error:
{{{
In file included from /usr/include/boost/atomic/detail/platform.hpp:22:0,
from /usr/include/boost/atomic/atomic.hpp:17,
from /usr/include/boost/atomic.hpp:12,
from /usr/include/boost/lockfree/detail/atomic.hpp:39,
from /usr/include/boost/lockfree/queue.hpp:22,
from errtest.cpp:2:
/usr/include/boost/atomic/detail/gcc-atomic.hpp: In member function âvoid
boost::atomics::detail::base_atomic<T, void, 8u, Sign>::store(const
value_type&, boost::memory_order) volatile [with T =
boost::lockfree::detail::tagged_ptr<boost::lockfree::queue<int>::node>;
bool Sign = false; boost::atomics::detail::base_atomic<T, void, 8u,
Sign>::value_type =
boost::lockfree::detail::tagged_ptr<boost::lockfree::queue<int>::node>]â:
/usr/include/boost/atomic/detail/gcc-atomic.hpp:35:39: error: inlining
failed in call to always_inline âconstexpr int
boost::atomics::detail::convert_memory_order_to_gcc(boost::memory_order)
noexceptâ:
BOOST_FORCEINLINE BOOST_CONSTEXPR int
convert_memory_order_to_gcc(memory_order order) BOOST_NOEXCEPT
^
In file included from /usr/include/boost/atomic/detail/platform.hpp:22:0,
from /usr/include/boost/atomic/atomic.hpp:17,
from /usr/include/boost/atomic.hpp:12,
from /usr/include/boost/lockfree/detail/atomic.hpp:39,
from /usr/include/boost/lockfree/queue.hpp:22,
from errtest.cpp:2:
/usr/include/boost/atomic/detail/gcc-atomic.hpp:764:87: error: called from
here
__atomic_store_n(&v_, tmp,
atomics::detail::convert_memory_order_to_gcc(order));
}}}
I am using an up-to-date arch linux system with gcc 4.9.0 and boost 1.55.0
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10204> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC