re PR testsuite/77734 (FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_ca...
authorJohn David Anglin <danglin@gcc.gnu.org>
Sun, 21 Jan 2018 18:15:31 +0000 (18:15 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 21 Jan 2018 18:15:31 +0000 (18:15 +0000)
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
gcc/config/pa/pa.c

index 4d56c473e68b13916f83e5bc8208bfc94d18f28e..0308f35d10fe3671a53be7ffd21113aa8f81717e 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-21  John David Anglin  <danglin@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.
+
 2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            David Edelsohn <dje.gcc@gmail.com>
 
index 809cc6566c21d3d6634abbca3e40e78b0aa1a7a6..0809a79cd50e2fe8f142fc21b02d36fde94033fe 100644 (file)
@@ -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