summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-20 23:24:39 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-20 23:24:39 +0000
commitf62b73b680caab24fa36bbc2f2c55e6b7a3847eb (patch)
tree9513667b50e316edb92635496711edf57728bbaf /gcc/config
parent079b59518b3a1b88a361b3322ec54dff17c6a5f1 (diff)
downloadgcc-f62b73b680caab24fa36bbc2f2c55e6b7a3847eb.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60377 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/pa/pa-linux.h5
-rw-r--r--gcc/config/pa/pa.c26
-rw-r--r--gcc/config/pa/pa32-linux.h8
3 files changed, 19 insertions, 20 deletions
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index a39ef318a00..b2c09981689 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -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) */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index cd52977abb6..651fc96eb37 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -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
diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h
index e8bc78322ee..c8e7b37012b 100644
--- a/gcc/config/pa/pa32-linux.h
+++ b/gcc/config/pa/pa32-linux.h
@@ -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