For x86 cross sh4-unknown-linux-gnu, 4.0.0 cc1plus segfaults
when compiling libstdc++-v3/src/localename.cc:
Program received signal SIGSEGV, Segmentation fault.
0x082d8e77 in regno_clobbered_p (regno=1139, insn=0x9bb9, mode=SImode, sets=0)
at ../../ORIG/gcc/gcc/reload.c:6931
6931 unsigned int nregs = hard_regno_nregs[regno][mode];
and the backtrace is
#0 0x082d8e77 in regno_clobbered_p (regno=1139, insn=0x9bb9, mode=SImode,
sets=0) at ../../ORIG/gcc/gcc/reload.c:6931
#1 0x082fe976 in emit_output_reload_insns (chain=0x92559e0, rl=0x84c7420, j=0)
at ../../ORIG/gcc/gcc/reload1.c:6702
#2 0x082ff237 in do_output_reload (chain=0x92559e0, rl=0x84c7420, j=0)
at ../../ORIG/gcc/gcc/reload1.c:6911
...
Thus the cause of segfault is that regno_clobbered_p is called for
a pseudo register 1139 while the first argument REGNO of regno_clobbered_p
must be a hard register:
regno_clobbered_p (unsigned int regno, rtx insn, enum machine_mode mode, int
sets)
{
unsigned int nregs = hard_regno_nregs[regno][mode];
unsigned int endregno = regno + nregs;
--
Summary: cc1plus segfaults when compiling libstdc++-
v3/src/localename.cc
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kkojima at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh4-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18511