This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/25196] [4.0/4.1 Regression] i386: wrong arguments passed
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2005 15:58:33 -0000
- Subject: [Bug rtl-optimization/25196] [4.0/4.1 Regression] i386: wrong arguments passed
- References: <bug-25196-4672@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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