Bug 14857 - [3.4/4.0 Regression]: Gcc segfault on duplicated asm statement
Summary: [3.4/4.0 Regression]: Gcc segfault on duplicated asm statement
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2004-04-05 19:31 UTC by H.J. Lu
Modified: 2004-09-13 14:15 UTC (History)
1 user (show)

See Also:
Host: ia64-unknown-linux-gnu
Target: ia64-unknown-linux-gnu
Build: ia64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2004-04-09 12:52:09


Attachments
A patch for global register variables (374 bytes, patch)
2004-04-06 17:51 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2004-04-05 19:31:46 UTC
[hjl@gnu-4 reg]$ cat foo.i
register char *__stack_pointer __asm__ ("sp");
register char *__stack_pointer __asm__ ("sp");
[hjl@gnu-4 reg]$ /usr/gcc-3.4/bin/gcc -S foo.i -v
Reading specs from /usr/gcc-3.4/lib/gcc/ia64-unknown-linux-gnu/3.4.0/specs
Configured with: /net/gnu/export/gnu/src/gcc-3.4/gcc/configure
--enable-clocale=gnu --with-system-zlib --enable-shared --enable-threads=posix
--enable-haifa --disable-checking --prefix=/usr/gcc-3.4
--with-local-prefix=/usr/local
Thread model: posix
gcc version 3.4.0 20040329 (prerelease)
 /usr/gcc-3.4/libexec/gcc/ia64-unknown-linux-gnu/3.4.0/cc1 -fpreprocessed foo.i
-quiet -dumpbase foo.i -auxbase foo -version -o foo.s
GNU C version 3.4.0 20040329 (prerelease) (ia64-unknown-linux-gnu)
        compiled by GNU C version 3.4.0 20040329 (prerelease).
GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=125552
foo.i: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.
Comment 1 H.J. Lu 2004-04-06 17:49:45 UTC
ia64_encode_section_info was removed in:

http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01251.html

and added back in

http://gcc.gnu.org/ml/gcc-cvs/2003-08/msg00259.html

But the new code doesn't handle global register variables.
Comment 2 H.J. Lu 2004-04-06 17:51:05 UTC
Created attachment 6044 [details]
A patch for global register variables
Comment 3 Jim Wilson 2004-04-08 02:48:24 UTC
Subject: Re:  [3.4/3.5 Regression]: Gcc segfault on duplicated
 asm statement

hjl at lucon dot org wrote:
 >	* config/ia64/ia64.c (ia64_encode_section_info): Don't prod
 >	global register variables.

OK.  This should be sent to gcc-patches if it hasn't been sent there yet.
Comment 4 Jim Wilson 2004-04-08 02:50:17 UTC
Subject: Re:  [3.4/3.5 Regression]: Gcc segfault on duplicated
 asm statement

hjl at lucon dot org wrote:
> A patch for global register variables

This needs approval from Mark Mitchell before it can be added to the 
gcc-3.4 branch.  I can only approve it for mainline at this time.
Comment 5 Andrew Pinski 2004-04-09 12:52:09 UTC
Confirmed.
Comment 6 GCC Commits 2004-04-21 15:14:57 UTC
Subject: Bug 14857

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	hjl@gcc.gnu.org	2004-04-21 15:14:54

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.c 

Log message:
	2004-04-21  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR target/14857
	Backport from mainline:
	
	* config/ia64/ia64.c (ia64_encode_section_info): Don't prod
	global register variables.

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.401&r2=2.2326.2.402
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.265.2.6&r2=1.265.2.7

Comment 7 Andrew Pinski 2004-04-21 15:28:47 UTC
Fixed.