https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382
Bug ID: 80382 Summary: ICE with error: unrecognizable insn Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- This testcase (which took ~5 days of reducing) ICEs with -O3 -std=c++11 -mtune=power8 -mcpu=power8 -mno-lra: test.C: In constructor ‘sbis::rpc::ProcessPool::ProcessPool(const String&, sbis::rpc::ProcessPoolType, sbis::EventLoopService*, sbis::EventReactionService*, const String&)’: test.C:195:37: error: unrecognizable insn: mSemaphore(U(G()), edCREATE) {} ^ (insn 16 15 17 2 (set (reg:PTI 169) (unspec:PTI [ (mem/v:TI (plus:DI (reg/f:DI 160 [ this ]) (const_int 8 [0x8])) [-1 S16 A128]) ] UNSPEC_LSQ)) "test.C":47 -1 (nil)) test.C:195:37: internal compiler error: in extract_insn, at recog.c:2311 0xcca398 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/marek/src/gcc/gcc/rtl-error.c:108 0xcca3c9 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) /home/marek/src/gcc/gcc/rtl-error.c:116 0xc9bcf1 extract_insn(rtx_insn*) /home/marek/src/gcc/gcc/recog.c:2311 0xa689f3 instantiate_virtual_regs_in_insn /home/marek/src/gcc/gcc/function.c:1589 0xa689f3 instantiate_virtual_regs /home/marek/src/gcc/gcc/function.c:1957 0xa689f3 execute /home/marek/src/gcc/gcc/function.c:2006 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. namespace std { template <typename> class allocator; template <class> struct char_traits; } typedef int size_t; namespace std { template <typename, typename, typename> class basic_string {}; } namespace mpl_ {} namespace boost { namespace mpl { using namespace mpl_; } } namespace mpl_ { struct void_; template <bool> struct bool_; typedef bool_<false> false_; template <bool C_> struct bool_ { static const bool value = C_; }; } namespace boost { namespace mpl { template <bool, typename, typename> struct if_c; template <typename T1, typename T2> struct if_c<false, T1, T2> { typedef T2 type; }; template <typename> struct is_not_void_ : false_ {}; } } namespace { typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> String; } namespace mpl_ { template <size_t N> struct size_t { static const ::size_t value = N; }; } namespace std { typedef enum { memory_order_relaxed } memory_order; template <typename _Tp> struct atomic { _Tp _M_i; atomic(_Tp) {} _Tp load(memory_order _m) { _Tp tmp; __atomic_load(&_M_i, &tmp, _m); } }; } namespace boost { namespace { namespace detail { using std::atomic; using std::memory_order_relaxed; } using detail::atomic; using detail::memory_order_relaxed; } namespace parameter { struct void_; template <class> struct optional; template <class> struct parameters { template <class = void_> struct bind; }; template <class, class, class> struct binding; } namespace lockfree { namespace tag { struct fixed_sized; struct capacity; } namespace detail { template <typename bound_args, typename tag_type> struct has_arg { typedef parameter::binding<bound_args, tag_type, mpl::void_> type; static const bool value = mpl::is_not_void_<type>::value; }; template <typename bound_args> struct extract_capacity { static const bool has_capacity = has_arg<bound_args, tag::capacity>::value; typedef typename mpl::if_c<has_capacity, typename has_arg<bound_args, tag::capacity>::type, mpl::size_t<0>>::type capacity_t; static const size_t capacity = capacity_t::value; }; template <typename, typename> struct extract_allocator; template <typename bound_args, bool default_ = false> struct extract_fixed_sized { static const bool has_fixed_sized = has_arg<bound_args, tag::fixed_sized>::value; typedef typename mpl::if_c<has_fixed_sized, typename has_arg<bound_args, tag::fixed_sized>::type, mpl::bool_<default_>>::type type; static const bool value = type::value; }; template <class T> class tagged_ptr { typedef size_t tag_t; T *ptr; tag_t tag; }; template <typename T> class freelist_stack { public: typedef tagged_ptr<T> tagged_node_handle; template <typename Allocator> freelist_stack(Allocator); }; template <typename, size_t> struct compiletime_sized_freelist_storage; template <typename> struct runtime_sized_freelist_storage; template <typename, typename> class fixed_size_freelist; template <typename T, typename Alloc, bool IsCompileTimeSized, bool IsFixedSize, size_t Capacity> struct select_freelist { typedef mpl::if_c<IsCompileTimeSized, compiletime_sized_freelist_storage<T, Capacity>, runtime_sized_freelist_storage<Alloc>> fixed_sized_storage_type; typedef typename mpl::if_c<IsFixedSize, fixed_size_freelist<T, fixed_sized_storage_type>, freelist_stack<Alloc>>::type type; }; typedef parameter::parameters<parameter::optional<tag::capacity>> queue_signature; } template <class = parameter::void_> class queue { typedef detail::queue_signature::bind<> bound_args; static const bool has_capacity = detail::extract_capacity<bound_args>::has_capacity; static const size_t capacity = detail::extract_capacity<bound_args>::capacity; static const bool fixed_sized = detail::extract_fixed_sized<bound_args>::value; static const bool compile_time_sized = has_capacity; struct node; typedef detail::extract_allocator<bound_args, node> node_allocator; typedef typename detail::select_freelist<node, node_allocator, compile_time_sized, fixed_sized, capacity>::type pool_t; typedef typename pool_t::tagged_node_handle tagged_node_handle; struct implementation_defined { typedef size_t size_type; }; public: typedef typename implementation_defined::size_type size_type; queue(size_type) : head_(tagged_node_handle()), tail_(tagged_node_handle()), pool(1) { head_.load(memory_order_relaxed); } atomic<tagged_node_handle> head_; atomic<tagged_node_handle> tail_; pool_t pool; }; } } namespace sbis { namespace rpc { enum ProcessPoolType : int; } class EventLoopService; class EventReactionService; namespace rpc { enum ExchangeDirection : int; class NamedSemaphore { public: NamedSemaphore(String, ExchangeDirection); }; class ProcessPool { ProcessPool(const String &, ProcessPoolType, EventLoopService *, EventReactionService *, const String &); boost::atomic<bool> mStarted; boost::lockfree::queue<> mNotifies; boost::atomic<size_t> mNumberOfProcesses; boost::atomic<size_t> mNumberOfThreads; boost::atomic<size_t> mNumberOfExtraProcesses; boost::atomic<int> mMaximumQueueSize; boost::atomic<size_t> mRequestQueueSize; NamedSemaphore mSemaphore; }; } } namespace boost { namespace uuids { struct uuid {}; } } namespace sbis { namespace rpc { enum ExchangeDirection : int { edCREATE }; } boost::uuids::uuid G(); String U(boost::uuids::uuid); namespace rpc { ProcessPool::ProcessPool(const String &, ProcessPoolType, EventLoopService *, EventReactionService *, const String &) : mStarted(false), mNotifies(0), mNumberOfProcesses(0), mNumberOfThreads(1), mNumberOfExtraProcesses(0), mMaximumQueueSize(0), mRequestQueueSize(0), mSemaphore(U(G()), edCREATE) {} } }