Bug 56268 - [4.7/4.8 Regression] C++11 ICE with boost multi-precision and boost variant during assignment
Summary: [4.7/4.8 Regression] C++11 ICE with boost multi-precision and boost variant d...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-09 18:58 UTC by koraq
Modified: 2013-02-21 18:56 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-02-11 00:00:00


Attachments
Sample code to reproduce the problem (162 bytes, text/x-c++src)
2013-02-09 18:58 UTC, koraq
Details
Preprocessed source (318.35 KB, application/octet-stream)
2013-02-09 18:59 UTC, koraq
Details
Somewhat reduced testcase (1.37 KB, text/plain)
2013-02-10 12:42 UTC, Markus Trippelsdorf
Details
gcc56268.C (805 bytes, text/plain)
2013-02-11 08:40 UTC, Jakub Jelinek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description koraq 2013-02-09 18:58:46 UTC
Created attachment 29402 [details]
Sample code to reproduce the problem

This issue is quite similar to bug 55842.

Compiling the attached sample file leads to an internal compiler error.
The problem only occurs with GCC-4.7 from Debian Unstable 4.7.2-5 and the
upcoming 4.8 from Debian Experimental 4.8-20130127-1. Tested on an amd64
system. (GCC 4.6 works, properly.)

I'm using a checkout of the latest boost release tree.

The command to reproduce the issue is:
gcc-4.8 -std=c++11 -c -I/src/boost/release test.cpp


In file included from /src/boost/release/boost/config.hpp:57:0,
                 from /src/boost/release/boost/variant/detail/config.hpp:16,
                 from /src/boost/release/boost/variant/variant.hpp:23,
                 from /src/boost/release/boost/variant.hpp:17,
                 from test.cpp:2:
/src/boost/release/boost/type_traits/has_nothrow_copy.hpp: In instantiation of 'const bool boost::detail::has_nothrow_copy_imp<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::value':
/src/boost/release/boost/type_traits/has_nothrow_copy.hpp:32:1:   required from 'struct boost::has_nothrow_copy<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >'
/src/boost/release/boost/variant/variant.hpp:1908:17:   required from 'void boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::assigner::internal_visit(const RhsT&, int) [with RhsT = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; T0_ = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; T1 = boost::detail::variant::void_; T2 = boost::detail::variant::void_; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_]'
/src/boost/release/boost/variant/detail/visitation_impl.hpp:130:9:   required from 'typename Visitor::result_type boost::detail::variant::visitation_impl_invoke_impl(int, Visitor&, VoidPtrCV, T*, mpl_::true_) [with Visitor = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::assigner; VoidPtrCV = const void*; T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; typename Visitor::result_type = void; mpl_::true_ = mpl_::bool_<true>]'
/src/boost/release/boost/variant/detail/visitation_impl.hpp:173:9:   required from 'typename Visitor::result_type boost::detail::variant::visitation_impl_invoke(int, Visitor&, VoidPtrCV, T*, NoBackupFlag, int) [with Visitor = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::assigner; VoidPtrCV = const void*; T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; NoBackupFlag = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::has_fallback_type_; typename Visitor::result_type = void]'
/src/boost/release/boost/variant/detail/visitation_impl.hpp:256:5:   required from 'typename Visitor::result_type boost::detail::variant::visitation_impl(int, int, Visitor&, VoidPtrCV, mpl_::false_, NoBackupFlag, Which*, step0*) [with Which = mpl_::int_<0>; step0 = boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<1l>, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >, boost::mpl::l_end> >, boost::mpl::l_iter<boost::mpl::l_end> >; Visitor = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::assigner; VoidPtrCV = const void*; NoBackupFlag = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::has_fallback_type_; typename Visitor::result_type = void; mpl_::false_ = mpl_::bool_<false>]'
/src/boost/release/boost/variant/variant.hpp:2326:13:   required from 'static typename Visitor::result_type boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::internal_apply_visitor_impl(int, int, Visitor&, VoidPtrCV) [with Visitor = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::assigner; VoidPtrCV = const void*; T0_ = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; T1 = boost::detail::variant::void_; T2 = boost::detail::variant::void_; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename Visitor::result_type = void]'
/src/boost/release/boost/variant/variant.hpp:2348:13:   required from 'typename Visitor::result_type boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::internal_apply_visitor(Visitor&) const [with Visitor = boost::variant<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> > >::assigner; T0_ = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; T1 = boost::detail::variant::void_; T2 = boost::detail::variant::void_; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename Visitor::result_type = void]'
/src/boost/release/boost/variant/variant.hpp:2091:13:   required from 'void boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::variant_assign(const boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with T0_ = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; T1 = boost::detail::variant::void_; T2 = boost::detail::variant::void_; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_]'
/src/boost/release/boost/variant/variant.hpp:2175:27:   required from 'boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>& boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::operator=(const boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with T0_ = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<64u, 0u> >; T1 = boost::detail::variant::void_; T2 = boost::detail::variant::void_; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_]'
test.cpp:16:4:   required from here
/src/boost/release/boost/type_traits/intrinsics.hpp:210:83: internal compiler error: in nothrow_spec_p, at cp/except.c:1263
 #   define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value)
                                                                                   ^
/src/boost/release/boost/type_traits/has_nothrow_copy.hpp:24:40: note: in expansion of macro 'BOOST_HAS_NOTHROW_COPY'
    BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T));
                                        ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccJawS1z.out file, please attach this to your bugreport.
Comment 1 koraq 2013-02-09 18:59:52 UTC
Created attachment 29403 [details]
Preprocessed source
Comment 2 Markus Trippelsdorf 2013-02-10 12:42:24 UTC
Created attachment 29410 [details]
Somewhat reduced testcase
Comment 3 Jakub Jelinek 2013-02-11 08:36:51 UTC
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175073
Comment 4 Jakub Jelinek 2013-02-11 08:40:19 UTC
Created attachment 29413 [details]
gcc56268.C

Tiny bit more reduced testcase.
Comment 5 Jason Merrill 2013-02-11 15:47:56 UTC
Author: jason
Date: Mon Feb 11 15:47:46 2013
New Revision: 195943

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195943
Log:
	PR c++/56268
	* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
	maybe_instantiate_noexcept.

Added:
    trunk/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
Comment 6 Jason Merrill 2013-02-11 16:21:19 UTC
Author: jason
Date: Mon Feb 11 16:21:10 2013
New Revision: 195945

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195945
Log:
	PR c++/56268
	* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
	maybe_instantiate_noexcept.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/semantics.c
Comment 7 Jason Merrill 2013-02-11 17:29:04 UTC
Fixed.
Comment 8 koraq 2013-02-21 18:56:06 UTC
I can confirm it is fixed in Debian Experimental 4.8-20130217-1. Thanks for the fix.