Bug 12934 - [3.4/4.0 regression] ICE with variable sized arrays in loc_descriptor_from_tree, at dwarf2out.c:8780
Summary: [3.4/4.0 regression] ICE with variable sized arrays in loc_descriptor_from_tr...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored, patch
: 13815 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-07 00:02 UTC by Jeff Bailey
Modified: 2004-09-13 14:15 UTC (History)
4 users (show)

See Also:
Host:
Target: any thing that use dwarf2
Build:
Known to work: 3.3
Known to fail:
Last reconfirmed: 2003-11-29 21:43:39


Attachments
Preprocessed source (48.07 KB, text/plain)
2003-11-07 00:04 UTC, Jeff Bailey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Bailey 2003-11-07 00:02:43 UTC
When compiling glibc for i386-gnu, I get the following error:

i386-gnu-gcc vfprintf.c -c -std=gnu99 -O2 -Wall -Winline -Wstrict-prototypes
-Wwrite-strings -g -Wno-parentheses -mpreferred-stack-boundary=2 
-Wno-uninitialized   -I../include -I.
-I/home/jbailey/Programming/cvstree/glibc/build.libc-hurd/stdio-common -I..
-I../libio -I../hurd
-I/home/jbailey/Programming/cvstree/glibc/build.libc-hurd/hurd/ -I../mach
-I/home/jbailey/Programming/cvstree/glibc/build.libc-hurd/mach/
-I/home/jbailey/Programming/cvstree/glibc/build.libc-hurd -I../sysdeps/i386/elf
-I../sysdeps/mach/hurd/i386 -I../sysdeps/mach/hurd -I../sysdeps/gnu
-I../sysdeps/unix/bsd/bsd4.4 -I../sysdeps/unix/mman -I../sysdeps/mach/i386
-I../sysdeps/mach -I../sysdeps/i386/fpu -I../sysdeps/i386
-I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/unix/bsd
-I../sysdeps/unix/common -I../sysdeps/unix/inet -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/ieee754 -I../sysdeps/generic/elf
-I../sysdeps/generic  -D_LIBC_REENTRANT -include ../include/libc-symbols.h 
-D_IO_MTSAFE_IO -o
/home/jbailey/Programming/cvstree/glibc/build.libc-hurd/stdio-common/vfprintf.o
-MD -MP -MF
/home/jbailey/Programming/cvstree/glibc/build.libc-hurd/stdio-common/vfprintf.o.dt
vfprintf.c: In function `_IO_vfprintf':
 
vfprintf.c:1917: internal compiler error: in loc_descriptor_from_tree, at
dwarf2out.c:8780
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

With the proprocessed source, the bug triggers as:

$ i386-gnu-gcc -O1 -g -c foo.c

-O2 triggers too.

I'll try to test a native compile, or one targetted to i386-linux.  I suspect
this will show up on at least one of those.
Comment 1 Jeff Bailey 2003-11-07 00:04:08 UTC
Created attachment 5080 [details]
Preprocessed source

Preprocessed source for vfprintf.c
Comment 2 Andrew Pinski 2003-11-07 00:21:55 UTC
Just to say this also happens on i686-pc-linux-gnu.
Comment 3 Volker Reichelt 2003-11-12 14:24:55 UTC
The testcase can be reduced to

===========================================
inline int foo() { return 0; }

void bar()
{
    int buf[foo()];
}
===========================================

which fails on i686-pc-linux-gnu with "gcc -O -g":

bug.c: In function `bar':

bug.c:6: internal compiler error: in loc_descriptor_from_tree, at
dwarf2out.c:8780
Please submit a full bug report, [etc.]

The bug only affects mainline.

According to Phil's regression hunter it appeared between
2003-04-11-trunk (#264) and 2003-04-12-trunk (#265)
(although I had to specify -O2 for the search).
Comment 4 Volker Reichelt 2003-11-12 14:49:46 UTC
The regression appeared with Zack's patch

http://gcc.gnu.org/ml/gcc-cvs/2003-04/msg00555.html

Zack, could you please have a look? Thanks!
Comment 5 Andrew Pinski 2003-12-19 06:45:06 UTC
One more for you Zack.
Comment 6 Jonathan Wakely 2003-12-30 16:14:09 UTC
For the record, this bug is also present on i386-unknown-freebsd4.8, built from
today's mainline:

test.cc: In function `void bar()':
test.cc:6: internal compiler error: in loc_descriptor_from_tree, at dwarf2out.c:8800


Reading specs from
/data/development/jw/gcc3/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4.0/specs
Configured with: /home/jw/src/extcvs/gcc/configure --prefix=/home/jw/gcc3/
--enable-languages=c,c++ --enable-concept-checks --enable-libstdcxx-pch
Thread model: posix
gcc version 3.4.0 20031230 (experimental)
Comment 7 Andrew Pinski 2004-01-24 05:40:32 UTC
Actually Zack, I do not think this one is really yours, see PR 13815.  The regression happened 
before your change.  It just so happens that your change also causes some other problems.
Comment 8 Andrew Pinski 2004-01-24 05:41:41 UTC
*** Bug 13815 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Pinski 2004-02-17 16:11:05 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01514.html>.
Comment 10 GCC Commits 2004-02-18 11:11:34 UTC
Subject: Bug 12934

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2004-02-18 11:11:25

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/gcc.dg/debug: debug-7.c 

Log message:
	Fix previous checkin.
	PR debug/12934
	* dwarf2out.c (loc_descriptor_from_tree): Handle
	EXPR_WITH_FILE_LOCATION.
	testsuite/
	* gcc.dg/debug/debug-7.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2819&r2=2.2820
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3514&r2=1.3515
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/debug-7.c.diff?cvsroot=gcc&r1=1.1&r2=1.2

Comment 11 GCC Commits 2004-02-18 11:23:35 UTC
Subject: Bug 12934

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	csl-arm-branch
Changes by:	pbrook@gcc.gnu.org	2004-02-18 11:23:28

Modified files:
	gcc            : ChangeLog dwarf2out.c 
	gcc/testsuite  : ChangeLog 

Log message:
	PR debug/12934
	* dwarf2out.c (loc_descriptor_from_tree): Handle
	EXPR_WITH_FILE_LOCATION.
	testsuite/
	* gcc.dg/debug/debug-7.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=2.1568.2.33&r2=2.1568.2.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.461.2.2&r2=1.461.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.3146.2.9&r2=1.3146.2.10

Comment 12 GCC Commits 2004-02-18 11:25:06 UTC
Subject: Bug 12934

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	pbrook@gcc.gnu.org	2004-02-18 11:24:51

Modified files:
	gcc            : ChangeLog dwarf2out.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg/debug: debug-7.c 

Log message:
	PR debug/12934
	* dwarf2out.c (loc_descriptor_from_tree): Handle
	EXPR_WITH_FILE_LOCATION.
	testsuite/
	* gcc.dg/debug/debug-7.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.211&r2=2.2326.2.212
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.478.2.4&r2=1.478.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.88&r2=1.3389.2.89
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/debug-7.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.2.1

Comment 13 Paul Brook 2004-02-18 11:26:30 UTC
Fixed.