Created attachment 22842 [details] Preprocessed source errtest.cpp: In lambda function: errtest.cpp:16:78: internal compiler error: in write_unnamed_type_name, at cp/mangle.c:1311 While using a mingw64 build I encountered the above ICE and reported it @ http://sourceforge.net/tracker/?func=detail&atid=983354&aid=3141173&group_id=202880 It was suggested that this is a gcc bug (and it looks like it). I'm using a lambda in a class template; as follows: std::sort(v.begin(),v.end(), [&eigenvaluesUnsorted](size_t a, size_t b) -> bool { return eigenvaluesUnsorted(a) > eigenvaluesUnsorted(b);}); Attached are the small unpreprocessed source, the huge preprocessed source, and g++'s output. The command line was: g++ -I%EIGEN3_DIR% --std=c++0x -march=core2 -v -save-temps errtest.cpp 2>gcc-err.txt
Created attachment 22843 [details] G++'s output
Created attachment 22844 [details] Unpreprocessed source (depends on Eigen3)
Oh, and finally: a comment on the mingw64 tracker is meaningless to me but perhaps useful to you: ktietz70 said: "So, I investigate your issue a bit. First this is for sure a gcc bug, which calls here write_unnamed_type_name for an ENUMERAL_TYPE, which isn't unnamed. The issue is related to write_nested_name, which doesn't special case here named enumeral types."
Has anyone seen this bug?
it might get analysed sooner if you try to reduce the code to something smaller than 70000 lines
Created attachment 23046 [details] slightly reduced and unincluded testcase confirmed with 4.5 and 4.6 attachment produced by g++46 -std=c++0x errtest.cc -Ieigen -DNDEBUG -DEIGEN_DONT_VECTORIZE -E | ~/src/gcc-4.6-20110101/contrib/uninclude (NDEBUG and EIGEN_DONT_VECTORIZE avoid non-portable assertions and intrinsics in the output)
(In reply to comment #5) > it might get analysed sooner if you try to reduce the code to something smaller > than 70000 lines Yeah, I realize: I've been putting that off, because, well, I don't exactly grok what the issue is and was hoping someone would say "oh, it's obviously just XYZ" without having to minimize the test case. I've tried removing the eigen headers and causing the ICE in a more manageable bit, but so far the resulting programs compile without ICE, so that's not helping. Thanks for the response anyhow - I was wondering whether anyone had spotted the report at all - I can empathize with feeling that it's not exactly a nice test-case...
Oops, I did mean to confirm this though - I can reproduce it
It is caused by revision 152429: http://gcc.gnu.org/ml/gcc-cvs/2009-10/msg00078.html which implements write_unnamed_type_name.
Reduced testcase: enum { E = 0, F = 1 }; template <int N, int M = ((N == 1) ? F : E)> class S; template <int N> struct T { static void foo (S<N> *p) { S<N> u; [&u] ()->bool {}; } };
Hm, this doesn't seem to be a regression. lambda is not supported in GCC 4.4, GCC 4.5.x ICE the same way as trunk. So, what version works for you (some unreleased SVN rev does not count, such a regression is not percieved as such from a users POV)? Unmarking as regression.
It is a regression in the sense that e.g. the #c10 testcase with 4.4 resulted in a bunch of errors, but not an ICE, while it ICEs in 4.6.
Author: jason Date: Sat May 28 00:53:49 2011 New Revision: 174375 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174375 Log: PR c++/47049 * semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing. * decl.c (start_preparsed_function): Don't call comdat_linkage for a template. Added: trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
Author: jason Date: Sat May 28 03:22:31 2011 New Revision: 174377 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174377 Log: PR c++/47049 * semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing. * decl.c (start_preparsed_function): Don't call comdat_linkage for a template. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template2.C Modified: branches/gcc-4_6-branch/gcc/cp/ChangeLog branches/gcc-4_6-branch/gcc/cp/decl.c branches/gcc-4_6-branch/gcc/cp/semantics.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed for 4.6.1.