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]

RFC: PATCH: PR rtl-optimization/38272: [4.4 Regression] Revision 142207 caused libgomp.fortran/threadprivate2.f90

IRA triggers a latent reload bug where do_input_reload use a register
spill for a memory input and the spilled register is diffrent from
the register to be reloaded into.  More detailed information is at

I tested this patch on Linux/ia32, Linux/ia64 and Linux/Intel without
any regressions.  Does it look OK?


2008-11-28  H.J. Lu  <>

	PR rtl-optimization/38272
	* reload1.c (do_input_reload): Don't use a spill for memory if it
	is different from the register to be reloaded into.

--- gcc/	2008-11-21 06:06:55.000000000 -0800
+++ gcc/reload1.c	2008-11-28 12:56:54.000000000 -0800
@@ -7508,6 +7508,8 @@ do_input_reload (struct insn_chain *chai
       && MEM_P (rl->in)
       && MEM_P (rl->in_reg)
       && reload_spill_index[j] >= 0
+      && (rl->reg_rtx == 0
+	  || REGNO (rl->reg_rtx) == (unsigned int) reload_spill_index[j])
       && TEST_HARD_REG_BIT (reg_reloaded_valid, reload_spill_index[j]))
     rl->in = regno_reg_rtx[reg_reloaded_contents[reload_spill_index[j]]];

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