Bug 53486 - ICE compiling code using lambdas as default argument
Summary: ICE compiling code using lambdas as default argument
Status: RESOLVED DUPLICATE of bug 55223
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: c++-lambda
Depends on:
Blocks: lambdas
  Show dependency treegraph
 
Reported: 2012-05-25 15:53 UTC by Jiří Paleček
Modified: 2022-03-11 00:32 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-05-29 00:00:00


Attachments
Compressed source file (300.49 KB, application/bzip2)
2012-05-25 17:58 UTC, Jiří Paleček
Details
Minimal testcase reproducing the error (136 bytes, application/octet-stream)
2012-05-26 20:32 UTC, Jiří Paleček
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Paleček 2012-05-25 15:53:54 UTC
When compiling the attached file with g++-4.7, (or the last snapshot available in Debian, that is from 20120501), I get the following internal compiler error:

benchmark_test.cpp:424:26: internal compiler error: in tsubst_copy, at cp/pt.c:12077
   simple_regression<dim> reg;
                          ^

The full output is:

-*- mode: compilation; default-directory: "~/benchmark/" -*-
Compilation started at Fri May 25 16:18:54

LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH PATH=/usr/lib/gcc-snapshot/bin:$PATH g++ -g --std=c++0x benchmark_test.cpp
benchmark_test.cpp: In instantiation of 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, int, func_type&, data_vector_type&, timer_type&, error_type&, variable_function_type&, random_type&) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>; timer_type = const clock_timer; error_type = const double; variable_function_type = const main()::<lambda(int)>; random_type = const boost::random::xor_combine_engine<boost::random::xor_combine_engine<boost::random::linear_feedback_shift_engine<unsigned int, 32, 31, 13, 12>, 0, boost::random::linear_feedback_shift_engine<unsigned int, 32, 29, 2, 4>, 0>, 0, boost::random::linear_feedback_shift_engine<unsigned int, 32, 28, 3, 17>, 0>]':
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, long int, func_type&, data_vector_type&, timer_type&, error_type&, variable_function_type&, boost::parameter::aux::use_default_tag) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>; timer_type = const clock_timer; error_type = const double; variable_function_type = const main()::<lambda(int)>]'
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, int, func_type&, data_vector_type&, timer_type&, error_type&, variable_function_type&) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>; timer_type = const clock_timer; error_type = const double; variable_function_type = const main()::<lambda(int)>]'
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, int, func_type&, data_vector_type&, timer_type&, error_type&) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>; timer_type = const clock_timer; error_type = const double]'
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, long int, func_type&, data_vector_type&, timer_type&, boost::parameter::aux::use_default_tag) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>; timer_type = const clock_timer]'
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, int, func_type&, data_vector_type&, timer_type&) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>; timer_type = const clock_timer]'
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, long int, func_type&, data_vector_type&, boost::parameter::aux::use_default_tag) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>]'
benchmark_test.cpp:404:1:   required from 'ResultType boost_param_default_415benchmark_regress(ResultType (*)(), const Args&, int, func_type&, data_vector_type&) [with ResultType = std::vector<double>; Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; func_type = const main()::<lambda(int)>; data_vector_type = const boost::assign_detail::generic_list<int>]'
benchmark_test.cpp:404:1:   required from 'typename boost_param_result_415benchmark_regress<Args>::type boost_param_implbenchmark_regress(const Args&) [with Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >, boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >, boost::parameter::aux::empty_arg_list> > >; typename boost_param_result_415benchmark_regress<Args>::type = std::vector<double>]'
benchmark_test.cpp:404:1:   required from 'typename boost_param_result_415benchmark_regress<typename boost::parameter::aux::argument_pack<boost_param_params_415benchmark_regress<int>, const ParameterArgumentType0, const ParameterArgumentType1, const ParameterArgumentType2>::type>::type benchmark_regress(const ParameterArgumentType0&, const ParameterArgumentType1&, const ParameterArgumentType2&, typename boost::parameter::aux::match<boost_param_params_415benchmark_regress<int>, ParameterArgumentType0, ParameterArgumentType1, ParameterArgumentType2>::type) [with ParameterArgumentType0 = boost::parameter::aux::tagged_argument<tag::func, const main()::<lambda(int)> >; ParameterArgumentType1 = boost::parameter::aux::tagged_argument<tag::data_vector, const boost::assign_detail::generic_list<int> >; ParameterArgumentType2 = boost::parameter::aux::tagged_argument<tag::variable_function, const main()::<lambda(int)> >; typename boost_param_result_415benchmark_regress<typename boost::parameter::aux::argument_pack<boost_param_params_415benchmark_regress<int>, const ParameterArgumentType0, const ParameterArgumentType1, const ParameterArgumentType2>::type>::type = std::vector<double>; typename boost::parameter::aux::match<boost_param_params_415benchmark_regress<int>, ParameterArgumentType0, ParameterArgumentType1, ParameterArgumentType2>::type = boost::parameter::parameters<boost::parameter::required<tag::func, boost::mpl::always<mpl_::bool_<true> > >, boost::parameter::required<tag::data_vector, boost::mpl::always<mpl_::bool_<true> > >, boost::parameter::optional<tag::timer, boost::mpl::always<mpl_::bool_<true> > >, boost::parameter::optional<tag::error, boost::mpl::always<mpl_::bool_<true> > >, boost::parameter::optional<tag::variable_function, boost::mpl::always<mpl_::bool_<true> > >, boost::parameter::optional<tag::random, boost::mpl::always<mpl_::bool_<true> > > >]'
benchmark_test.cpp:474:167:   required from here
benchmark_test.cpp:424:26: internal compiler error: in tsubst_copy, at cp/pt.c:12077
   simple_regression<dim> reg;
                          ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.
Preprocessed source stored into /home/jirka/tmp/cccYhoSw.out file, please attach this to your bugreport.

Compilation exited abnormally with code 1 at Fri May 25 16:19:13
Comment 1 Jonathan Wakely 2012-05-25 16:17:53 UTC
No attached file, no testcase, no version, no 'gcc -v' output. Please see the bug reporting instructions.
Comment 2 Jiří Paleček 2012-05-25 17:55:39 UTC
Sorry for the missing test file, it was somehow lost in the bug submission process. The compiler version is

jirka@debian:~/benchmark$ LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH PATH=/usr/lib/gcc-snapshot/bin:$PATH g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/i486-linux-gnu/4.8.0/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 20120501-1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs --enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++ --prefix=/usr/lib/gcc-snapshot --enable-shared --enable-linker-build-id --with-system-zlib --disable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-snap/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-snap --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-snap --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --disable-werror --enable-checking=yes --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.8.0 20120501 (experimental) [trunk revision 187013] (Debian 20120501-1)
Comment 3 Jiří Paleček 2012-05-25 17:58:50 UTC
Created attachment 27499 [details]
Compressed source file

Sorry again, the file was too big.
Comment 4 Jonathan Wakely 2012-05-25 18:13:29 UTC
Thanks. 

If the file's too big to upload maybe it's a hint you should try to reduce it to something more manageable, as requested in the bug reporting instructions: http://gcc.gnu.org/bugs/minimize.html
Comment 5 Jiří Paleček 2012-05-25 18:29:19 UTC
If I got a minimal testcase, but a slightly different error message, what should I do?
Comment 6 Jiří Paleček 2012-05-26 20:32:07 UTC
Created attachment 27505 [details]
Minimal testcase reproducing the error
Comment 7 Richard Biener 2012-05-29 10:31:24 UTC
Confirmed.
Comment 8 Paolo Carlini 2013-02-15 12:05:03 UTC
Dup. Testcase doesn't ICE anymore.

*** This bug has been marked as a duplicate of bug 55223 ***