From 560382452e8e5651f6c0829a9c6f3f835446c1ab Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Wed, 21 Dec 2005 15:28:16 +0000 Subject: patch for PR rtl-optimization/25130 gcc/ * postreload-gcse.c (record_last_set_info): Notice stack pointer changes in push insns without REG_INC notes. testsuite/ * gcc.dg/pr25130.c: New test. From-SVN: r108906 --- gcc/postreload-gcse.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'gcc/postreload-gcse.c') diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c index 191d796..4fc66ec 100644 --- a/gcc/postreload-gcse.c +++ b/gcc/postreload-gcse.c @@ -671,10 +671,18 @@ record_last_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED, void *data) if (REG_P (dest)) record_last_reg_set_info (last_set_insn, REGNO (dest)); - else if (MEM_P (dest) - /* Ignore pushes, they clobber nothing. */ - && ! push_operand (dest, GET_MODE (dest))) - record_last_mem_set_info (last_set_insn); + else if (MEM_P (dest)) + { + /* Ignore pushes, they don't clobber memory. They may still + clobber the stack pointer though. 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. Note + such changes here too. */ + if (! push_operand (dest, GET_MODE (dest))) + record_last_mem_set_info (last_set_insn); + else + record_last_reg_set_info (last_set_insn, STACK_POINTER_REGNUM); + } } -- cgit v1.1