This is the mail archive of the gcc-patches@gcc.gnu.org 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:

Hi,

The appended patch is to avoid the failure described in

http://gcc.gnu.org/ml/gcc/2004-11/msg00143.html

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.

Regards,
	kaz
--
2004-11-16  Kaz Kojima  <kkojima@gcc.gnu.org>

	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 (old) < FIRST_PSEUDO_REGISTER)
+ && regno_clobbered_p (REGNO (old), insn, rl->mode, 0)))
gen_reload (old, reloadreg, rl->opnum,
rl->when_needed);
}


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


See: http://gcc.gnu.org/ml/gcc/1998-05/msg00297.html .

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]