Allow indirect sibcall with register arguments
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 10 Jul 2015 20:30:10 +0000 (20:30 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 10 Jul 2015 20:30:10 +0000 (13:30 -0700)
commita0ff7835afe337464d8235a50b9a3fc06ccc7586
tree853a4dab0f9999a5a26b2b91f5029e74503d9032
parentbb49ee66ef413295fee5f319d3c4129b624bbf8e
Allow indirect sibcall with register arguments

Indirect sibcall with register arguments is OK when there is register
available for argument passing.

gcc/

PR target/66819
* config/i386/i386.c (ix86_function_ok_for_sibcall): Allow
indirect sibcall with register arguments if register available
for argument passing.
(init_cumulative_args): Set cfun->machine->arg_reg_available
to (cum->nregs > 0) or to true if function has a variable
argument list.
(function_arg_advance_32): Set cfun->machine->arg_reg_available
to false if cum->nregs <= 0.
* config/i386/i386.h (machine_function): Add arg_reg_available.

gcc/testsuite/

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

From-SVN: r225688
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr66819-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66819-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66819-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66819-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66819-5.c [new file with mode: 0644]