etienne@fulbert:~/projet/gujin$ gcc -v Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs Configured with: ../src/configure -v --enable-languages=c,c++,f77,objc,ada -- prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx- include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable- nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu -- enable-objc-gc i386-linux Thread model: posix gcc version 3.2.3 (Debian) etienne@fulbert:~/projet/gujin$ cat f.c #define _ 0 #define X 1 #define B(p0, p1, p2, p3, p4, p5, p6, p7) \ {{p7, p6, p5, p4, p3, p2, p1, p0}} union font_line_u { struct { unsigned char b0 :1, b1 :1, b2 :1, b3 :1, b4 :1, b5 :1, b6 :1, b7 :1; } __attribute__ ((packed)) bit; unsigned char group; } __attribute__ ((packed)); const union font_line_u font8x8[256][8] = { ['e'] = { B (_,_,_,_,_,_,_,_), B (_,_,_,_,_,_,_,_), B (_,_,_,X,_,_,_,_), B (_,_,X,_,X,_,_,_), B (_,_,X,X,_,_,_,_), B (_,_,X,_,_,_,_,_), B (_,_,_,X,X,_,_,_), B (_,_,_,_,_,_,_,_), }, ['รจ'] = { /* e grave */ B (_,_,_,X,_,_,_,_), B (_,_,_,_,X,_,_,_), B (_,_,_,X,_,X,_,_), B (_,_,X,_,X,_,_,_), B (_,_,X,X,_,_,_,_), B (_,_,X,_,_,_,_,_), B (_,_,_,X,X,_,_,_), B (_,_,_,_,_,_,_,_), }, }; etienne@fulbert:~/projet/gujin$ gcc -c f.c -funsigned-char etienne@fulbert:~/projet/gujin$ gcc -c f.c f.c:24: Internal compiler error in tree_low_cst, at tree.c:3485 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. etienne@fulbert:~/projet/gujin$
Confirmed on 3.4 20030614. Testcase: char font8x8[256][8] = { [-1] = { 0 } }; test.c:1: internal compiler error: in tree_low_cst, at tree.c:3406
It's a regression introduced between 3.0 and 3.2. 2.95 gives this error: g/x> gcc -c x.c x.c:24: duplicate array index in initializer x.c:24: (near initialization for `font8x8') Maybe this gives a another clue as to what goes wrong. W.
*** Bug 11333 has been marked as a duplicate of this bug. ***
Postponed until GCC 3.3.2.
From Phil's regression hunter: : Search converges between 2002-04-21-trunk (#74) and 2002-04-28-trunk (#75).
The regression in PR 11207 was introduced or exposed by this patch: --- gcc/gcc/ChangeLog --- 2002-04-26 Alexandre Oliva <aoliva@redhat.com> * tree.c (tree_int_cst_lt): Compare constants whose types differ in unsigned-ness correctly. The regression hunt used the small test case from comment #1 on i686-pc-linux-gnu. Before this patch, compiling that test case gets: 11207.c:1: array index in initializer exceeds array bounds 11207.c:1: (near initialization for `font8x8')
A patch was submitted for this: <http://gcc.gnu.org/ml/gcc-patches/2003-08/ msg00606.html>.
Subject: Re: [3.3/3.4 regression] ICE with negative index in array element designator On Sun, 2003-08-10 at 08:28, pinskia at gcc dot gnu dot org wrote: > PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11207 > > > > ------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-10 15:28 ------- > A patch was submitted for this: <http://gcc.gnu.org/ml/gcc-patches/2003-08/ > msg00606.html>. That patch is OK for 3.3 and mainline. Please install!
Subject: Bug 11207 CVSROOT: /cvs/gcc Module name: gcc Changes by: kraai@gcc.gnu.org 2003-08-19 01:36:29 Modified files: gcc : ChangeLog c-typeck.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg/noncompile: 20030818-1.c Log message: PR c/11207 * c-typeck.c (set_init_index): Check for negative index. (testsuite/) * gcc.dg/noncompile/20030818-1.c: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.798&r2=2.799 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.252&r2=1.253 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2975&r2=1.2976 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/20030818-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 11207 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: kraai@gcc.gnu.org 2003-08-19 01:42:37 Modified files: gcc : ChangeLog c-typeck.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg/noncompile: 20030818-1.c Log message: PR c/11207 * c-typeck.c (set_init_index): Check for negative index. (testsuite/) * gcc.dg/noncompile/20030818-1.c: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.708&r2=1.16114.2.709 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.213.2.7&r2=1.213.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.250&r2=1.2261.2.251 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/20030818-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
Fixed by the patch above for 3.3.2 and 3.4.