public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index
@ 2003-10-14 11:49 gcc-bugzilla at gcc dot gnu dot org
2003-10-14 16:33 ` [Bug c++/12613] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-10-14 11:49 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12613
Summary: [3.3/3.4] ICE on initializer with an array index
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ban at ipl dot t dot u-tokyo dot ac dot jp
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i486-pc-linux-gnu
GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu
A declaration of an array with an array index causes an ICE on 3.3/3.4.
When C++ parser calls build_tree_list() (or tree_cons()) with
PURPOSE parameter, this function makes a TREE node which TREE_PURPOSE is
non-NULL. Then reshape_init()'s array initializer processing routine
passes its PURPOSE to size_binop(), which causes type mismatch and an ICE.
Environment:
(a) Debian GNU/Linux testing (GCC version 3.3.2 20030908 (Debian prerelease))
and
(b) FreeBSD 5.1-CURRENT (GCC version 3.3.1)
and
(c) FreeBSD 4.8 (GCC 3.4 cvs at 2003/10/07 (JST))
* More information about (a):
Packages: (result from `dpkg -l g++ g++-3.3')
ii g++ 3.3.1-2 The GNU C++ compiler.
ii g++-3.3 3.3.2-0pre4 The GNU C++ compiler
Architecture: i686
host: i486-pc-linux-gnu
build: i486-pc-linux-gnu
target: i486-pc-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.2 20030908 (Debian prerelease)
* More information about (b):
% uname -a
FreeBSD sto.ipl.t.u-tokyo.ac.jp 5.1-CURRENT FreeBSD 5.1-CURRENT #3: Wed Oct 1 19:30:06 JST 2003 root@sto.ipl.t.u-tokyo.ac.jp:/work/src/sys/i386/compile/STO i386
% gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.3.1 [FreeBSD]
* More information about (c):
% gcc -v
Using built-in specs.
Configured with: ./configure --enable-languages=c++,c
Thread model: posix
gcc version 3.4 20031006 (experimental)
How-To-Repeat:
To compile these files:
---- ice1.ii
int a[] = { [1] 1 };
---- ice2.ii
enum { FOO = 1, BAR = 2 };
int a[] = { FOO: 1, BAR: 2 };
---- ice3.ii
int a[] = { FOO: 1, BAR: 2 };
---- end
ice1.ii is GCC's old-style C-extention code, and ice2.ii and ice3.ii
are both invalid code.
LOG:
% g++ ice1.ii
ice1.ii:1: internal compiler error: in size_binop, at fold-const.c:1459
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
% g++ ice2.ii
ice2.ii:2: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
% g++ ice3.ii
ice3.ii:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
------- Additional Comments From ban at ipl dot t dot u-tokyo dot ac dot jp 2003-10-14 11:49 -------
Fix:
This patch avoids the ICE:
--- gcc/cp/decl.c.old 2003-09-02 15:03:24.000000000 +0900
+++ gcc/cp/decl.c 2003-10-11 03:52:11.000000000 +0900
@@ -8364,7 +8364,10 @@
TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = element_init;
if (TREE_PURPOSE (element_init))
- index = TREE_PURPOSE (element_init);
+ {
+ /* index = TREE_PURPOSE (element_init); */
+ sorry ("initializer with an array index");
+ }
}
}
else
More constructive solution would be to port C's code (and parser)
to C++. It handles a C-extention of designated initializers
much better.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12613] [3.3/3.4] ICE on initializer with an array index
2003-10-14 11:49 [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index gcc-bugzilla at gcc dot gnu dot org
@ 2003-10-14 16:33 ` pinskia at gcc dot gnu dot org
2003-11-21 17:03 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-14 16:33 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12613
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-10-14 16:33:31
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-10-14 16:33 -------
The first testcase does not ICE on the mainline:
tin:~/src/gnu/gcctest>gcc pr12613.cc
pr12613.cc:1: error: expected primary-expression
pr12613.cc:1: error: expected `}'
pr12613.cc:1: error: expected `,' or `;'
pr12613.cc:1: error: expected declaration
The second and third one does ICE but the 2.95.3 produced a sorry for all three (so I do not know
if this counts as a regression):
tin:~/src/gnu/gcctest>~/ia32_linux_gcc2_95//bin/gcc pr12613.2.cc
pr12613.2.cc:1: sorry, not implemented: non-trivial labeled initializers
pr12613.2.cc:1: sorry, not implemented: non-trivial labeled initializers
tin:~/src/gnu/gcctest>~/ia32_linux_gcc2_95//bin/gcc pr12613.1.cc
pr12613.1.cc:2: sorry, not implemented: non-trivial labeled initializers
pr12613.1.cc:2: sorry, not implemented: non-trivial labeled initializers
tin:~/src/gnu/gcctest>~/ia32_linux_gcc2_95//bin/gcc pr12613.cc
pr12613.cc:1: sorry, not implemented: non-trivial labeled initializers
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12613] [3.3/3.4] ICE on initializer with an array index
2003-10-14 11:49 [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index gcc-bugzilla at gcc dot gnu dot org
2003-10-14 16:33 ` [Bug c++/12613] " pinskia at gcc dot gnu dot org
@ 2003-11-21 17:03 ` pinskia at gcc dot gnu dot org
2003-12-29 4:54 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-21 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-21 17:03 -------
*** Bug 13151 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dig at mirky dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12613
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12613] [3.3/3.4] ICE on initializer with an array index
2003-10-14 11:49 [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index gcc-bugzilla at gcc dot gnu dot org
2003-10-14 16:33 ` [Bug c++/12613] " pinskia at gcc dot gnu dot org
2003-11-21 17:03 ` pinskia at gcc dot gnu dot org
@ 2003-12-29 4:54 ` cvs-commit at gcc dot gnu dot org
2003-12-29 6:25 ` [Bug c++/12613] [3.3] " mmitchel at gcc dot gnu dot org
2004-01-03 13:49 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-29 4:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-12-29 02:42 -------
Subject: Bug 12613
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2003-12-29 02:42:17
Modified files:
gcc/cp : ChangeLog decl.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/opt: inline6.C
gcc/testsuite/g++.dg/parse: error9.C
Log message:
PR c++/13081
* decl.c (duplicate_decls): Preserve inline-ness when redeclaring
a function template.
PR c++/12613
* decl.c (reshape_init): Reject GNU colon-style designated
initializers in arrays.
PR c++/13081
* g++.dg/opt/inline6.C: New test.
PR c++/12613
* g++.dg/parse/error9.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3837&r2=1.3838
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1168&r2=1.1169
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3315&r2=1.3316
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/inline6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error9.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12613
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12613] [3.3] ICE on initializer with an array index
2003-10-14 11:49 [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2003-12-29 4:54 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-29 6:25 ` mmitchel at gcc dot gnu dot org
2004-01-03 13:49 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-12-29 6:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2003-12-29 02:44 -------
Fixed in GCC 3.4.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.3/3.4] ICE on initializer|[3.3] ICE on initializer
|with an array index |with an array index
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12613
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12613] [3.3] ICE on initializer with an array index
2003-10-14 11:49 [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2003-12-29 6:25 ` [Bug c++/12613] [3.3] " mmitchel at gcc dot gnu dot org
@ 2004-01-03 13:49 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-03 13:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-03 13:49 -------
Was fixed for 3.4.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12613
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-01-03 13:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-14 11:49 [Bug c++/12613] New: [3.3/3.4] ICE on initializer with an array index gcc-bugzilla at gcc dot gnu dot org
2003-10-14 16:33 ` [Bug c++/12613] " pinskia at gcc dot gnu dot org
2003-11-21 17:03 ` pinskia at gcc dot gnu dot org
2003-12-29 4:54 ` cvs-commit at gcc dot gnu dot org
2003-12-29 6:25 ` [Bug c++/12613] [3.3] " mmitchel at gcc dot gnu dot org
2004-01-03 13:49 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).