This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFC] PR target/18511: Cross build failure on sh4-unknown-linux-gnu

Kaz Kojima wrote:


The appended patch is to avoid the failure described in

which is preventing x86 cross sh4-unknown-linux-gnu builds since
Oct 29.  I hope that the experts will comment about this because
the reload is beyond my powers.
Anyway, the patch is tested with bootstraps on i686-linux and
sh4-unknown-linux-gnu without new regressions.

2004-11-16  Kaz Kojima  <>

	PR target/18511
	* reload1.c (emit_output_reload_insns): Check if OLD is a hard
	register before calling regno_clobbered_p.

diff -uprN ORIG/gcc/gcc/reload1.c LOCAL/gcc/gcc/reload1.c
--- ORIG/gcc/gcc/reload1.c 2004-11-13 10:52:51.000000000 +0900
+++ LOCAL/gcc/gcc/reload1.c 2004-11-16 09:57:11.000000000 +0900
@@ -6706,7 +6706,8 @@ emit_output_reload_insns (struct insn_ch
|| !(set = single_set (insn))
|| rtx_equal_p (old, SET_DEST (set))
|| !reg_mentioned_p (old, SET_SRC (set))
- || !regno_clobbered_p (REGNO (old), insn, rl->mode, 0))
+ && regno_clobbered_p (REGNO (old), insn, rl->mode, 0)))
gen_reload (old, reloadreg, rl->opnum,

I think this patch is safe. The code in question, although originally proposed
as a fix to paper over an, was accepted only as an optimization
after the bug was fixed. So the safe thing to do is to emit the reload.

See: .

To give some background on what kind of reloads we are dealing with here:
The first three tests will cover most normal reloads, but not some SUBREG
destinations where the entire hard rregister / word of the pseudo is reloaded,
or auto-increment reloads. Auto-increment reloads will be either for a hard
register of the wrong class, or a pseudo register. In particular, for the SH family,
auto-increment reloads for pseudo registers happen from time to time.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]