diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-21 15:28:16 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-21 15:28:16 +0000 |
commit | 5630a23e0a4e483c8c405a32782d01f4b64f6654 (patch) | |
tree | 4f288befddb9d14189f3a940fb389582659ff8ec /gcc/postreload-gcse.c | |
parent | 2226345888ecbe934332f522097ad22c407e2efc (diff) | |
download | gcc-5630a23e0a4e483c8c405a32782d01f4b64f6654.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108906 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/postreload-gcse.c')
-rw-r--r-- | gcc/postreload-gcse.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c index 191d7965eeb..4fc66ec4ee6 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); + } } |