This is the mail archive of the
mailing list for the GCC project.
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Jan 2005 20:17:07 -0800
- Subject: fix rtl-opt/10692
Kudos to Roman for some excellent diagnosis.
As seen in the dumps in comment 13, note that reg 277 is used twice.
This is what promoted reload 0 to RELOAD_OTHER. When that happens,
we don't have a record of all the locations within the insn that
reference the data.
Which means that the pitiful amount of life analysis that happens
within this if conditional is insufficient. The only simple, and
therefore reliable, solution is to ignore the hard cases entirely.
Bootstrappend and tested on i686-linux, fwiw. Committed to 3.4/4.0.
* reload1.c (do_input_reload): Restrict the optimization deleteing
a previous output reload to RELOAD_FOR_INPUT.
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.456
diff -c -p -d -r1.456 reload1.c
*** reload1.c 23 Dec 2004 04:53:48 -0000 1.456
--- reload1.c 6 Jan 2005 04:05:46 -0000
*************** do_input_reload (struct insn_chain *chai
*** 6822,6827 ****
--- 6822,6831 ----
actually no need to store the old value in it. */
+ /* Only attempt this for input reloads; for RELOAD_OTHER we miss
+ that there may be multiple uses of the previous output reload.
+ Restricting to RELOAD_FOR_INPUT is mostly paranoia. */
+ && rl->when_needed == RELOAD_FOR_INPUT
&& (reload_inherited[j] || reload_override_in[j])
&& REG_P (rl->reg_rtx)