diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-03-05 17:24:43 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-03-05 17:24:43 +0100 |
commit | 537400180d36469bf97daeb28d23161fe9ed022a (patch) | |
tree | 4d83d3726e4fba22de7c4e2671152fd8e8eb1ebb /gcc/config | |
parent | a2460abb82e2fd3c45edf5e9f4ff61151ef8d815 (diff) | |
download | gcc-537400180d36469bf97daeb28d23161fe9ed022a.zip gcc-537400180d36469bf97daeb28d23161fe9ed022a.tar.gz gcc-537400180d36469bf97daeb28d23161fe9ed022a.tar.bz2 |
re PR target/84564 (error: unable to find a register to spill with -mforce-indirect-call)
PR target/84564
* config/i386/i386.c (ix86_function_ok_for_sibcall): Check for
regparm >= 3 with no arg reg available also for calls with
flag_force_indirect_call. Pass decl to ix86_function_regparm.
* gcc.target/i386/pr84564.c: New test.
From-SVN: r258256
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 9cdc96f..e352303 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6415,7 +6415,8 @@ ix86_function_ok_for_sibcall (tree decl, tree exp) function via GOT slot are indirect. */ if (!decl || (bind_global && flag_pic && !flag_plt) - || (TARGET_DLLIMPORT_DECL_ATTRIBUTES && DECL_DLLIMPORT_P (decl))) + || (TARGET_DLLIMPORT_DECL_ATTRIBUTES && DECL_DLLIMPORT_P (decl)) + || flag_force_indirect_call) { /* Check if regparm >= 3 since arg_reg_available is set to false if regparm == 0. If regparm is 1 or 2, there is @@ -6424,7 +6425,7 @@ ix86_function_ok_for_sibcall (tree decl, tree exp) ??? The symbol indirect call doesn't need a call-clobbered register. But we don't know if this is a symbol indirect call or not here. */ - if (ix86_function_regparm (type, NULL) >= 3 + if (ix86_function_regparm (type, decl) >= 3 && !cfun->machine->arg_reg_available) return false; } |