Summary: | [3.3/3.4 regression] ICE with negative index in array element designator | ||
---|---|---|---|
Product: | gcc | Reporter: | etienne.lorrain |
Component: | c | Assignee: | Mark Mitchell <mmitchel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aoliva, gcc-bugs, reichelt, tharbaugh |
Priority: | P1 | Keywords: | ice-on-invalid-code, monitored |
Version: | 3.2.3 | ||
Target Milestone: | 3.3.2 | ||
Host: | i386 Linux | Target: | i386 Linux |
Build: | i386 Linux | Known to work: | |
Known to fail: | Last reconfirmed: | 2003-08-03 17:32:22 |
Description
etienne.lorrain
2003-06-16 10:37:39 UTC
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. |