pa-linux.h (TARGET_HAS_STUBS_AND_ELF_SECTIONS): Delete define.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Fri, 20 Dec 2002 23:24:39 +0000 (23:24 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 20 Dec 2002 23:24:39 +0000 (23:24 +0000)
* pa-linux.h (TARGET_HAS_STUBS_AND_ELF_SECTIONS): Delete define.
* pa32-linux.h (FUNCTION_OK_FOR_SIBCALL): Delete define.
* pa.c (pa_function_ok_for_sibcall): Allow non indirect sibcalls on
TARGET_ELF32.  Add comment on sibcall issues for TARGET_64BIT.

From-SVN: r60377

gcc/ChangeLog
gcc/config/pa/pa-linux.h
gcc/config/pa/pa.c
gcc/config/pa/pa32-linux.h

index d7e51d71bd24c08ebd223183df59187ff7d11b5b..ff855b7439e8af8387bdacd5de813c9311e4e5eb 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-20  John David Anglin  <dave.anglin@nrc.gc.ca>
+
+       * pa-linux.h (TARGET_HAS_STUBS_AND_ELF_SECTIONS): Delete define.
+       * pa32-linux.h (FUNCTION_OK_FOR_SIBCALL): Delete define.
+       * pa.c (pa_function_ok_for_sibcall): Allow non indirect sibcalls on
+       TARGET_ELF32.  Add comment on sibcall issues for TARGET_64BIT.
+
 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300-protos.h: Add prototypes for
index a39ef318a00dd014d688a041353ebc47a14a2836..b2c0998168905f4afb9546d062d07678e0b00925 100644 (file)
@@ -167,11 +167,6 @@ Boston, MA 02111-1307, USA.  */
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP ".globl "
 
-/* This definition is used inside pa.c to disable all
-   sibcall optimization, because sibcalls, stubs and
-   elf sections don't play well.  */
-#define TARGET_HAS_STUBS_AND_ELF_SECTIONS 1
-
 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
    labels in a function declaration (since pa.c seems determined to do
    it differently)  */
index cd52977abb67abd8f4e78ce17c47137a2507c1b2..651fc96eb37101887bec604339c6697bb35d7d13 100644 (file)
@@ -6878,14 +6878,26 @@ pa_function_ok_for_sibcall (decl, exp)
      tree decl;
      tree exp ATTRIBUTE_UNUSED;
 {
-#ifdef TARGET_HAS_STUBS_AND_ELF_SECTIONS
-  /* Sibcalls, stubs, and elf sections don't play well.  */
-  return false;
-#endif
+  /* Sibcalls are ok for TARGET_ELF32 as along as the linker is used in
+     single subspace mode and the call is not indirect.  As far as I know,
+     there is no operating system support for the multiple subspace mode.
+     It might be possible to support indirect calls if we didn't use
+     $$dyncall (see the indirect sequence generated in output_call).  */
+  if (TARGET_ELF32)
+    return (decl != NULL_TREE);
+
+  /* Sibcalls are not ok because the arg pointer register is not a fixed
+     register.  This prevents the sibcall optimization from occuring.  In
+     addition, there are problems with stub placement using GNU ld.  This
+     is because a normal sibcall branch uses a 17-bit relocation while
+     a regular call branch uses a 22-bit relocation.  As a result, more
+     care needs to be taken in the placement of long-branch stubs.  */
+  if (TARGET_64BIT)
+    return false;
+
   return (decl
-         && ! TARGET_PORTABLE_RUNTIME
-         && ! TARGET_64BIT
-         && ! TREE_PUBLIC (decl));
+         && !TARGET_PORTABLE_RUNTIME
+         && !TREE_PUBLIC (decl));
 }
 
 /* Returns 1 if the 6 operands specified in OPERANDS are suitable for
index e8bc78322ee62747808c51302fc9038bd33d75d1..c8e7b37012b041833e22115ae0917745870199ee 100644 (file)
@@ -22,14 +22,6 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_ELF32
 #define TARGET_ELF32 1
 
-/* Sibcalls are ok when ld is used in single subspace mode.  The
-   multiple subspace mode is not compatible with sibcalls to external
-   functions because the linker generated stubs store the return
-   pointer into the frame.  This target does not need multiple
-   subspace stubs, so we allow sibcalls to all functions.  */
-#undef FUNCTION_OK_FOR_SIBCALL
-#define FUNCTION_OK_FOR_SIBCALL(DECL) 1
-
 /* The libcall __canonicalize_funcptr_for_compare is referenced in
    crtend.o and the reference isn't resolved in objects that don't
    compare function pointers.  Thus, we need to play games to provide