This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.4-BIB] x86-64 sibcall fixes
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Tue, 15 Oct 2002 19:58:07 +0200
- Subject: [3.4-BIB] x86-64 sibcall fixes
Hi,
this patch fix two problems I found while looking into the sibcall
code on x86-64. Otherwise it seems to do the sibcalls
What else is missing?
Honza
Tue Oct 15 19:55:00 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.h (FUNCTION_OK_FOR_SIBCALL): Allow sibcalls in 64bit PIC.
(override_options): Disable MASK_FLOAT_RETURNS for 64bit ABI.
*** i386.h Mon Oct 14 12:07:58 2002
--- /abuild/jh/egcs1/gcc/config/i386/i386.h Tue Oct 15 18:25:28 2002
*************** typedef struct ix86_args {
*** 1686,1692 ****
instruction will wind up after the sibcall jump, and not be executed.) */
#define FUNCTION_OK_FOR_SIBCALL(DECL) \
((DECL) \
! && (! flag_pic || ! TREE_PUBLIC (DECL)) \
&& (! TARGET_FLOAT_RETURNS_IN_80387 \
|| ! FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (DECL)))) \
|| FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (cfun->decl))))))
--- 1686,1692 ----
instruction will wind up after the sibcall jump, and not be executed.) */
#define FUNCTION_OK_FOR_SIBCALL(DECL) \
((DECL) \
! && (TARGET_64BIT || ! flag_pic || ! TREE_PUBLIC (DECL)) \
&& (! TARGET_FLOAT_RETURNS_IN_80387 \
|| ! FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (DECL)))) \
|| FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (cfun->decl))))))
*** i386.c Tue Oct 15 10:24:34 2002
--- /abuild/jh/egcs1/gcc/config/i386/i386.c Tue Oct 15 18:26:31 2002
*************** override_options ()
*** 1226,1231 ****
--- 1226,1233 ----
error ("-mrtd calling convention not supported in the 64bit mode");
/* Enable by default the SSE and MMX builtins. */
target_flags |= (MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE);
+ /* We always return floats in SSE, not 80387. */
+ target_flags &= MASK_FLOAT_RETURNS;
ix86_fpmath = FPMATH_SSE;
}
else