Bug 29226 - [4.0 regression] ICE in make_decl_rtl, at varasm.c:886
Summary: [4.0 regression] ICE in make_decl_rtl, at varasm.c:886
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P1 normal
Target Milestone: 4.1.2
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: 29435
  Show dependency treegraph
 
Reported: 2006-09-25 22:23 UTC by Debian GCC Maintainers
Modified: 2007-02-03 20:25 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work: 2.95.4 3.3.6 3.4.0 4.1.2 4.2.0 4.3.0
Known to fail: 4.0.4 4.1.1
Last reconfirmed: 2006-09-25 22:32:19


Attachments
preprocess source (248 bytes, text/plain)
2006-09-25 22:23 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2006-09-25 22:23:06 UTC
[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.
Comment 1 Debian GCC Maintainers 2006-09-25 22:23:43 UTC
Created attachment 12328 [details]
preprocess source
Comment 2 Debian GCC Maintainers 2006-09-25 22:25:30 UTC
sorry, doesn't work in 3.4.6, but in 3.3 and 2.95

  Matthias
Comment 3 Andrew Pinski 2006-09-25 22:32:19 UTC
Confirmed.
sizeof (int [w]));
is causing it.
Comment 4 Andrew Pinski 2006-09-26 07:05:44 UTC
Reduced testcase:
template <bool>
static int label (int w)
{
  sizeof(int[w]);
}
int a = label<false>(1);



So I was correct :)
Comment 5 Andrew Pinski 2006-09-26 17:47:03 UTC
When I get home, I might have a look at this, most likely pt.c needs to be extended.
Comment 6 Andrew Pinski 2006-10-02 07:31:18 UTC
Hmm, the sizeof expression causes use to create the expression:
(cast)NON_LVALUE_EXPR<SAVE_EXPR<(cast)(w)*4>>
Comment 7 Mark Mitchell 2006-10-02 22:21:11 UTC
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

Comment 8 Mark Mitchell 2006-10-02 23:42:08 UTC
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

Comment 9 Gabriel Dos Reis 2007-02-03 20:25:52 UTC
Fixed in GCC-4.1.2.