diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-25 18:57:48 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-25 18:57:48 +0000 |
commit | 40125f1c8fc1fdff755fe372aca2b0a4a7473c31 (patch) | |
tree | ba68cdf5cb12fb41f9051ea44e08934bd8482ab0 /gcc/cfgcleanup.c | |
parent | 8e1e2c20cf2e02e2de59df8ebce08b22df778d0f (diff) | |
download | gcc-40125f1c8fc1fdff755fe372aca2b0a4a7473c31.tar.gz |
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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 19 |
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); |