From e55b72cfb384105c6be87051c1182c05c481cd87 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sun, 21 Jan 2018 18:15:31 +0000 Subject: [PATCH] re PR testsuite/77734 (FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_call_plugin.so (test for excess errors)) PR gcc/77734 * config/pa/pa.c (pa_function_ok_for_sibcall): Use targetm.binds_local_p instead of TREE_PUBLIC to check local binding. Move TARGET_PORTABLE_RUNTIME check after TARGET_64BIT check. From-SVN: r256934 --- gcc/ChangeLog | 7 +++++++ gcc/config/pa/pa.c | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d56c47..0308f35 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-21 John David Anglin + + PR gcc/77734 + * config/pa/pa.c (pa_function_ok_for_sibcall): Use + targetm.binds_local_p instead of TREE_PUBLIC to check local binding. + Move TARGET_PORTABLE_RUNTIME check after TARGET_64BIT check. + 2018-01-21 Bill Schmidt David Edelsohn diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 809cc65..0809a79 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -8655,9 +8655,6 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta, static bool pa_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) { - if (TARGET_PORTABLE_RUNTIME) - return false; - /* Sibcalls are not ok because the arg pointer register is not a fixed register. This prevents the sibcall optimization from occurring. In addition, there are problems with stub placement using GNU ld. This @@ -8667,8 +8664,11 @@ pa_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) if (TARGET_64BIT) return false; + if (TARGET_PORTABLE_RUNTIME) + return false; + /* Sibcalls are only ok within a translation unit. */ - return (decl && !TREE_PUBLIC (decl)); + return decl && targetm.binds_local_p (decl); } /* ??? Addition is not commutative on the PA due to the weird implicit -- 2.7.4