[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.
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.
Created attachment 6044 [details] A patch for global register variables
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.
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.
Confirmed.
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
Fixed.