User account creation filtered due to spam.

Bug 8160 - ICE in build_modify_expr, at cp/typeck.c:5494: Array initialization
Summary: ICE in build_modify_expr, at cp/typeck.c:5494: Array initialization
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2002-10-07 08:16 UTC by sdementen
Modified: 2003-07-25 17:33 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
error_build_modify_expr.cpp (149 bytes, application/octet-stream)
2003-05-21 15:16 UTC, sdementen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdementen 2002-10-07 08:16:01 UTC
Compilation of the file leads to

error_build_modify_expr.cpp: In constructor `foo<D>::foo() [with int D = 1]':
error_build_modify_expr.cpp:15:   instantiated from here
error_build_modify_expr.cpp:11: Internal compiler error in build_modify_expr, at cp/typeck.c:5494
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:https://qa.mandrakesoft.com/> for instructions.

Release:
gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)

Environment:
Fresh Mandrake 9.0 installation (gcc-2.96 is also installed)

How-To-Repeat:
Compile the file with no special flags

g++ error_build_modify_expr.cpp
Comment 2 Kriang Lerdsuwanakij 2002-10-27 06:44:32 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.
Comment 3 Wolfgang Bangerth 2002-10-30 11:24:23 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/8160: ICE in build_modify_expr, at cp/typeck.c:5494: Array
 initialization
Date: Wed, 30 Oct 2002 11:24:23 -0600 (CST)

 Regression vs. 2.95. Reduced code is this:
 -------------------------
 template <int D> struct C {
   int d[3];
   C();
 };
 
 template<int D>
 C<D>::C() : d((int[]){1,2,3}) {};
 
 template class C<1>;
 -----------------------------
 I think, this code is actually using a gcc extension
 with the (int[]){1,2,3} thingy. I am also not exactly
 sure whether this is legal (using "int[]" over "int[3]"),
 and changing it to the latter form makes the
 bug go away as well.
 
 Nevertheless, it worked with 2.95.
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 

Comment 4 Mark Mitchell 2002-10-30 16:08:14 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in GCC 3.2.1.
Comment 5 Mark Mitchell 2002-10-31 00:02:36 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8160
Date: 31 Oct 2002 00:02:36 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	mmitchel@gcc.gnu.org	2002-10-30 16:02:36
 
 Modified files:
 	gcc/testsuite  : ChangeLog 
 	gcc/cp         : ChangeLog decl.c typeck2.c 
 Added files:
 	gcc/testsuite/g++.dg/template: complit1.C typename4.C 
 
 Log message:
 	PR c++/8160
 	* g++.dg/template/complit1.C: New test.
 	
 	PR c++/8149
 	* g++.dg/template/typename4.C: Likewise.
 	
 	PR c++/8160
 	* typeck2.c (process_init_constructor): Call complete_array_type.
 	
 	PR c++/8149
 	* decl.c (make_typename_type): Issue errors about invalid results.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.43&r2=1.1672.2.166.2.44
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/complit1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typename4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114.2.37&r2=1.2685.2.114.2.38
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.866.2.36.2.11&r2=1.866.2.36.2.12
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.117.2.2.2.1&r2=1.117.2.2.2.2
 

Comment 6 Mark Mitchell 2002-10-31 00:02:36 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8160
Date: 31 Oct 2002 00:02:36 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	mmitchel@gcc.gnu.org	2002-10-30 16:02:36
 
 Modified files:
 	gcc/testsuite  : ChangeLog 
 	gcc/cp         : ChangeLog decl.c typeck2.c 
 Added files:
 	gcc/testsuite/g++.dg/template: complit1.C typename4.C 
 
 Log message:
 	PR c++/8160
 	* g++.dg/template/complit1.C: New test.
 	
 	PR c++/8149
 	* g++.dg/template/typename4.C: Likewise.
 	
 	PR c++/8160
 	* typeck2.c (process_init_constructor): Call complete_array_type.
 	
 	PR c++/8149
 	* decl.c (make_typename_type): Issue errors about invalid results.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.43&r2=1.1672.2.166.2.44
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/complit1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typename4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114.2.37&r2=1.2685.2.114.2.38
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.866.2.36.2.11&r2=1.866.2.36.2.12
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.117.2.2.2.1&r2=1.117.2.2.2.2
 

Comment 7 Mark Mitchell 2002-10-31 00:04:13 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8160
Date: 31 Oct 2002 00:04:13 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2002-10-30 16:04:13
 
 Modified files:
 	gcc/testsuite  : ChangeLog 
 	gcc/cp         : ChangeLog decl.c typeck2.c 
 Added files:
 	gcc/testsuite/g++.dg/template: complit1.C typename4.C 
 
 Log message:
 	PR c++/8160
 	* typeck2.c (process_init_constructor): Call complete_array_type.
 	
 	PR c++/8149
 	* decl.c (make_typename_type): Issue errors about invalid results.
 	
 	PR c++/8160
 	* g++.dg/template/complit1.C: New test.
 	
 	PR c++/8149
 	* g++.dg/template/typename4.C: Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2193&r2=1.2194
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/complit1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typename4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3032&r2=1.3033
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.958&r2=1.959
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.131&r2=1.132
 

Comment 8 Mark Mitchell 2002-10-31 00:04:13 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8160
Date: 31 Oct 2002 00:04:13 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2002-10-30 16:04:13
 
 Modified files:
 	gcc/testsuite  : ChangeLog 
 	gcc/cp         : ChangeLog decl.c typeck2.c 
 Added files:
 	gcc/testsuite/g++.dg/template: complit1.C typename4.C 
 
 Log message:
 	PR c++/8160
 	* typeck2.c (process_init_constructor): Call complete_array_type.
 	
 	PR c++/8149
 	* decl.c (make_typename_type): Issue errors about invalid results.
 	
 	PR c++/8160
 	* g++.dg/template/complit1.C: New test.
 	
 	PR c++/8149
 	* g++.dg/template/typename4.C: Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2193&r2=1.2194
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/complit1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typename4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3032&r2=1.3033
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.958&r2=1.959
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.131&r2=1.132