[forwarded from http://bugs.debian.org/388263] works, in 3.4.6, not in 4.0, 4.1, trunk SVN. $ g++ -c 388626.ii gcc-4-bug.cc: In function 'int label(int) [with bool neighb8 = true]': gcc-4-bug.cc:21: internal compiler error: in make_decl_rtl, at varasm.c:886 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 12328 [details] preprocess source
sorry, doesn't work in 3.4.6, but in 3.3 and 2.95 Matthias
Confirmed. sizeof (int [w])); is causing it.
Reduced testcase: template <bool> static int label (int w) { sizeof(int[w]); } int a = label<false>(1); So I was correct :)
When I get home, I might have a look at this, most likely pt.c needs to be extended.
Hmm, the sizeof expression causes use to create the expression: (cast)NON_LVALUE_EXPR<SAVE_EXPR<(cast)(w)*4>>
Subject: Bug 29226 Author: mmitchel Date: Mon Oct 2 22:21:02 2006 New Revision: 117375 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117375 Log: PR c++/29226 * typeck.c (cxx_sizeof_or_alignof_type): Tidy. In templates, do not try to actually evaluate sizeof for a VLA type. PR c++/29226 * g++.dg/template/vla1.C: New test. Added: trunk/gcc/testsuite/g++.dg/template/vla1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 29226 Author: mmitchel Date: Mon Oct 2 23:41:59 2006 New Revision: 117377 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117377 Log: PR c++/29226 * typeck.c (cxx_sizeof_or_alignof_type): Tidy. In templates, do not try to actually evaluate sizeof for a VLA type. PR c++/29226 * g++.dg/template/vla1.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/vla1.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/typeck.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in GCC-4.1.2.