This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Cross build failure on sh4-unknown-linux-gnu
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 04 Nov 2004 09:38:26 +0900 (JST)
- Subject: Cross build failure on sh4-unknown-linux-gnu
Hi,
I've ran into a build failure on mainline for i686-linux cross
sh4-unknown-linux-gnu. Weirdly, there is no problem on the native
bootstrap on sh4-unknown-linux-gnu. It started October 29 after
the various tree stuff changes. I suspect that these changes
reveal a latent problem. The failure is a segfault which occures
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
#3 0x082ff54e in emit_reload_insns (chain=0x92559e0)
at ../../ORIG/gcc/gcc/reload1.c:6976
#4 0x082f1662 in reload_as_needed (live_known=1)
at ../../ORIG/gcc/gcc/reload1.c:3843
#5 0x082eab71 in reload (first=0xbd8dff60, global=1)
at ../../ORIG/gcc/gcc/reload1.c:1071
...
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:
6928 regno_clobbered_p (unsigned int regno, rtx insn, enum machine_mode mode,6929 int sets)
6930 {
6931 unsigned int nregs = hard_regno_nregs[regno][mode];
6932 unsigned int endregno = regno + nregs;
The code of emit_output_reload_insns which calls this regno_clobbered_p
looks like:
6700 /* Don't output the last reload if OLD is not the dest of
6701 INSN and is in the src and is clobbered by INSN. */
6702 if (! flag_expensive_optimizations
6703 || !REG_P (old)
6704 || !(set = single_set (insn))
6705 || rtx_equal_p (old, SET_DEST (set))
6706 || !reg_mentioned_p (old, SET_SRC (set))
6707 || !regno_clobbered_p (REGNO (old), insn, rl->mode, 0))
6708 gen_reload (old, reloadreg, rl->opnum,
6709 rl->when_needed);
So it seems the code assumes that OLD is a hard register here. Is it
right?
Regards,
kaz