x86: Use DRAP only if there are outgoing arguments on stack
commit84066338f533756496dc8ce09726fe8dad8b0cf5
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Jul 2017 18:25:49 +0000 (9 18:25 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Jul 2017 18:25:49 +0000 (9 18:25 +0000)
tree958a5f65c985b55904f9ac79c387b66910f49bfc
parentcd34ead70340b4c38b9e94f8905e580e924d61bc
x86: Use DRAP only if there are outgoing arguments on stack

Since DRAP is needed only if there are outgoing arguments on stack, we
should track outgoing arguments on stack and avoid setting need_drap to
true when there are no outgoing arguments on stack.

gcc/

PR target/81313
* config/i386/i386.c (ix86_function_arg_advance): Set
outgoing_args_on_stack to true if there are outgoing arguments
on stack.
(ix86_function_arg): Likewise.
(ix86_get_drap_rtx): Use DRAP only if there are outgoing
arguments on stack and ACCUMULATE_OUTGOING_ARGS is false.
* config/i386/i386.h (machine_function): Add
outgoing_args_on_stack.

gcc/testsuite/

PR target/81313
* gcc.target/i386/pr81313-1.c: New test.
* gcc.target/i386/pr81313-2.c: Likewise.
* gcc.target/i386/pr81313-3.c: Likewise.
* gcc.target/i386/pr81313-4.c: Likewise.
* gcc.target/i386/pr81313-5.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250084 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr81313-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81313-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81313-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81313-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81313-5.c [new file with mode: 0644]