The attached change fixes the failure of
gcc.dg/plugin/must-tail-call-1.c on hppa-linux. Using
targetm.binds_local_p is less restrictive than TREE_PUBLIC in
determining what binds local.
Tested on hppa-unknown-linux-gnu. Committed to trunk.
Dave
--
John David Anglin dave.ang...@bell.net
2018-01-21 John David Anglin <dang...@gcc.gnu.org>
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.
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 256932)
+++ config/pa/pa.c (working copy)
@@ -8655,9 +8655,6 @@
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 @@
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