diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-18 00:14:25 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-18 00:14:25 +0000 |
commit | 290099730f0592a1fece5843baf0a791b6fba200 (patch) | |
tree | 278ecdb9349e9803c322668f500b07eecf4d7b25 /gcc/lra-remat.c | |
parent | 5240f96a55db98b04275fda34c891fbbc629b825 (diff) | |
download | gcc-290099730f0592a1fece5843baf0a791b6fba200.tar.gz |
2014-11-17 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/63906
* lra-remat.c (operand_to_remat): Check SP and
frame_pointer_required.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-remat.c')
-rw-r--r-- | gcc/lra-remat.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/lra-remat.c b/gcc/lra-remat.c index fcb1b6f6097..3b8a8069de9 100644 --- a/gcc/lra-remat.c +++ b/gcc/lra-remat.c @@ -399,7 +399,13 @@ operand_to_remat (rtx_insn *insn) /* First find a pseudo which can be rematerialized. */ for (reg = id->regs; reg != NULL; reg = reg->next) - if (reg->type == OP_OUT && ! reg->subreg_p + /* True FRAME_POINTER_NEEDED might be because we can not follow + changing sp offsets, e.g. alloca is used. If the insn contains + stack pointer in such case, we can not rematerialize it as we + can not know sp offset at a rematerialization place. */ + if (reg->regno == STACK_POINTER_REGNUM && frame_pointer_needed) + return -1; + else if (reg->type == OP_OUT && ! reg->subreg_p && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL) { /* We permits only one spilled reg. */ |