summaryrefslogtreecommitdiff
path: root/gcc/auto-inc-dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/auto-inc-dec.c')
-rw-r--r--gcc/auto-inc-dec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 91fa5cf0bbe..db1bd5bba2c 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -769,6 +769,12 @@ parse_add_or_inc (rtx_insn *insn, bool before_mem)
inc_insn.pat = pat;
inc_insn.reg_res = SET_DEST (pat);
inc_insn.reg0 = XEXP (SET_SRC (pat), 0);
+
+ /* Block any auto increment of the frame pointer since it expands into
+ an addition and cannot be removed by copy propagation. */
+ if (inc_insn.reg0 == frame_pointer_rtx)
+ return false;
+
if (rtx_equal_p (inc_insn.reg_res, inc_insn.reg0))
inc_insn.form = before_mem ? FORM_PRE_INC : FORM_POST_INC;
else