This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
freload_combine bug fix
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Fri, 20 Jan 2006 20:50:16 +0000
- Subject: freload_combine bug fix
The attached bug should fix a bug in reload_combine that was found because
of a Linux kernel miscompilation. I won't be able to test this patch
for a few days.
2006-01-20 J"orn Rennecke <joern.rennecke@st.com>
* combine.c (reload_combine): For every new use of REG_SUM, record
the use of BASE.
--- postreload.c@@/main/SH5GCC-3.4.3-int/0 2006-01-20 14:59:05.000000000 +0000
+++ postreload.c 2006-01-20 20:21:41.000000000 +0000
@@ -886,6 +886,23 @@ reload_combine (void)
{
rtx *np;
+ /* For every new use of REG_SUM, we have to record the use
+ of BASE therein. */
+ for (i = reg_state[regno].use_index;
+ i < RELOAD_COMBINE_MAX_USES; i++)
+ {
+ rtx *basep = &XEXP (*reg_state[regno].reg_use[i].usep, 1);
+ rtx use_insn = reg_state[regno].reg_use[i].insn;
+
+ if (*basep != base)
+ abort ();
+ reload_combine_note_use (basep, use_insn);
+ }
+ if (reg_state[REGNO (base)].use_ruid
+ > reg_state[regno].use_ruid)
+ reg_state[REGNO (base)].use_ruid
+ = reg_state[regno].use_ruid;
+
/* Delete the reg-reg addition. */
delete_insn (insn);