summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-26 09:58:28 +0000
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-26 09:58:28 +0000
commitc62f411b3c564e3bc2e231ec8fb8072c23a0a785 (patch)
tree2eccc3d73bf8aaf67a16ef370aea53376e5e186a /gcc/calls.c
parente2225bd419ce30e32adc080be8cfe407d649fc95 (diff)
downloadgcc-c62f411b3c564e3bc2e231ec8fb8072c23a0a785.tar.gz
[calls.c] PR rtl-optimization/67226: Take into account pretend_args_size when checking stack offsets for sibcall optimisation
2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com> Bernd Schmidt <bschmidt@redhat.com> PR rtl-optimization/67226 * calls.c (store_one_arg): Take into account crtl->args.pretend_args_size when checking for overlap between arg->value and argblock + arg->locate.offset during sibcall optimization. * gcc.c-torture/execute/pr67226.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230929 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index b56556a9d0a..6cbe01970c1 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -4939,6 +4939,13 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
if (XEXP (x, 0) != crtl->args.internal_arg_pointer)
i = INTVAL (XEXP (XEXP (x, 0), 1));
+ /* arg.locate doesn't contain the pretend_args_size offset,
+ it's part of argblock. Ensure we don't count it in I. */
+ if (STACK_GROWS_DOWNWARD)
+ i -= crtl->args.pretend_args_size;
+ else
+ i += crtl->args.pretend_args_size;
+
/* expand_call should ensure this. */
gcc_assert (!arg->locate.offset.var
&& arg->locate.size.var == 0