aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-08-25 18:57:48 +0000
committerRichard Henderson <rth@redhat.com>2011-08-25 18:57:48 +0000
commitdeb004260cdfba7c80acb582a4ee540f7a7daffa (patch)
treeba68cdf5cb12fb41f9051ea44e08934bd8482ab0 /gcc/cfgcleanup.c
parent12d43372e019c316cfff39af1fa41278cdbb9442 (diff)
PR 50132
PR 49864 * cfgcleanup.c (old_insns_match_p): Don't allow cross-jump for non-constant stack adjutment. * expr.c (find_args_size_adjust): Break out from ... (fixup_args_size_notes): ... here. * rtl.h (find_args_size_adjust): Declare. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@178084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 717301354e7..396057cc19b 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1081,11 +1081,20 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2)
/* ??? Do not allow cross-jumping between different stack levels. */
p1 = find_reg_note (i1, REG_ARGS_SIZE, NULL);
p2 = find_reg_note (i2, REG_ARGS_SIZE, NULL);
- if (p1)
- p1 = XEXP (p1, 0);
- if (p2)
- p2 = XEXP (p2, 0);
- if (!rtx_equal_p (p1, p2))
+ if (p1 && p2)
+ {
+ p1 = XEXP (p1, 0);
+ p2 = XEXP (p2, 0);
+ if (!rtx_equal_p (p1, p2))
+ return dir_none;
+
+ /* ??? Worse, this adjustment had better be constant lest we
+ have differing incoming stack levels. */
+ if (!frame_pointer_needed
+ && find_args_size_adjust (i1) == HOST_WIDE_INT_MIN)
+ return dir_none;
+ }
+ else if (p1 || p2)
return dir_none;
p1 = PATTERN (i1);