[PATCH] reload fix for the compile/20000127-1.c failure on sparc64-linux

Jakub Jelinek jakub@redhat.com
Thu Jan 27 10:49:00 GMT 2000


Hi!

After some investigation (together with Jan Hubicka) we found that
emit_input_reload_insns does not honour PREFERRED_RELOAD_CLASS NO_REGS
forcing of constants to memory. rl->in in this case is the correct MEM
of the constant in memory which just need to be reloaded so that the address
is build, while oldequiv is (const_int 1) in the testcase.
Without this patch, gcc calls gen_movsi which tries to validize that memory,
but aborts because it cannot do it during reload, but with this patch
gen_reload handles the address just fine.

2000-01-27  Jakub Jelinek  <jakub@redhat.com>

	* reload1.c (emit_input_reload_insns): Honour forcing of constants
	into memory by PREFERRED_RELOAD_CLASS NO_REGS.

--- gcc/reload1.c.jj	Tue Jan 18 22:33:00 2000
+++ gcc/reload1.c	Thu Jan 27 19:26:44 2000
@@ -6326,7 +6326,10 @@ emit_input_reload_insns (chain, rl, old,
 	      && ((reg_equiv_memory_loc
 		   [REGNO (SUBREG_REG (oldequiv))] != 0)
 		  || (reg_equiv_constant
-		      [REGNO (SUBREG_REG (oldequiv))] != 0))))
+		      [REGNO (SUBREG_REG (oldequiv))] != 0)))
+	  || (CONSTANT_P (oldequiv)
+	      && PREFERRED_RELOAD_CLASS (oldequiv,
+			REGNO_REG_CLASS (REGNO (reloadreg))) == NO_REGS))
 	real_oldequiv = rl->in;
       gen_reload (reloadreg, real_oldequiv, rl->opnum,
 		  rl->when_needed);

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.41 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________


More information about the Gcc-patches mailing list