[Bug rtl-optimization/25196] [4.0/4.1 Regression] i386: wrong arguments passed
------- Comment #8 from steven at gcc dot gnu dot org 2005-12-20 15:58 -------
Gross. According to a comment in postreload.c:move2add_note_store(), we can
have pushes without REG_INC notes:
/* Some targets do argument pushes without adding REG_INC notes. */
So we need to go look for those {pre,post}{decrements,increments} ourselves.
With this patch, we just do what postreload.c does.
Index: postreload-gcse.c
===================================================================
--- postreload-gcse.c (revision 108853)
+++ postreload-gcse.c (working copy)
@@ -676,6 +676,17 @@ record_last_set_info (rtx dest, rtx sett
/* Ignore pushes, they clobber nothing. */
&& ! push_operand (dest, GET_MODE (dest)))
record_last_mem_set_info (last_set_insn);
+
+ /* ??? Some targets do argument pushes without adding REG_INC notes.
+ See e.g. PR25196, where a pushsi2 on i386 doesn't have REG_INC
+ notes. */
+ if (MEM_P (dest))
+ {
+ dest = XEXP (dest, 0);
+ if (GET_CODE (dest) == PRE_INC || GET_CODE (dest) == POST_INC
+ || GET_CODE (dest) == PRE_DEC || GET_CODE (dest) == POST_DEC)
+ record_last_reg_set_info (last_set_insn, REGNO (XEXP (dest, 0)));
+ }
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25196
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply to: