This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.4 bib] Sibcalls on x86_64
- From: Andreas Bauer <baueran at in dot tum dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Oct 2002 09:20:11 +1000
- Subject: [3.4 bib] Sibcalls on x86_64
Hi all,
While testing some things with my many cross-compilers, I stumbled across
this one in 'i386.c': it is not possible to have any sibcall
optimisation at all on x86_64, due to the line
/* We don't have 64-bit patterns in place. */
if (TARGET_64BIT)
...
in 'ix86_function_ok_for_sibcall'. To me that seems too conservative as
there are sibcall patterns for x86_64, just none to support indirect
calls yet (as we now have them for i386).
My attached patch fixes this, if I didn't miss out on any other obvious
points that should prevent it from being applied.
2002-10-24 Andreas Bauer <baueran@in.tum.de>
* config/i386/i386.c (ix86_function_ok_for_sibcall): Allow
sibcall optimisation only for direct calls on x86_64.
Index: config/i386/i386.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.447.2.16
diff -u -p -r1.447.2.16 i386.c
--- config/i386/i386.c 21 Oct 2002 20:53:21 -0000 1.447.2.16
+++ config/i386/i386.c 23 Oct 2002 23:02:00 -0000
@@ -1382,8 +1382,8 @@ ix86_function_ok_for_sibcall (decl, exp)
tree decl;
tree exp;
{
- /* We don't have 64-bit patterns in place. */
- if (TARGET_64BIT)
+ /* We don't have 64-bit patterns for indirect calls in place. */
+ if (!decl && TARGET_64BIT)
return false;
/* If we are generating position-independent code, we cannot sibcall