On Mon, May 14, 2007 at 10:47:13PM +0100, Mark Shinwell wrote: > I'm fairly certain that this is the correct approach to fix this > issue, but I'm less certain that I have correctly guarded the call > to forget_old_reloads_1, [snip] > Index: reload1.c > =================================================================== > --- reload1.c (revision 170932) > +++ reload1.c (working copy) > @@ -7506,6 +7506,9 @@ emit_reload_insns (struct insn_chain *ch > } > } > > + if (i < 0 && rld[r].in != NULL_RTX && rld[r].reg_rtx != NULL_RTX) > + forget_old_reloads_1 (rld[r].reg_rtx, NULL_RTX, NULL); > + > /* The following if-statement was #if 0'd in 1.34 (or before...). > It's reenabled in 1.35 because supposedly nothing else > deals with this problem. */
It seems to me that the only special thing happening in your testcase is that reload.in(_reg) is a PLUS rather than a REG or MEM. Does you patch not prevent reload inheritance in many cases where it would be OK? Hmm, the immediately preceeding if() block begins: /* I is nonneg if this reload used a register. If rld[r].reg_rtx is 0, this is an optional reload that we opted to ignore. */ if (i >= 0 && rld[r].reg_rtx != 0) { I'd like a similiar comment just before your code. It is the i < 0 in your case which prevents the preceeding if() block from updating reg_reloaded_valid and so on. -- Rask Ingemann Lambertsen