This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix unnamed complex arguments passing (SPARC64)
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 Jul 2003 11:24:36 +0200
- Subject: [PATCH] Fix unnamed complex arguments passing (SPARC64)
Hi,
The SPARC 64-bit ABI specifies that unnamed FP arguments are passed in the 6
integer slots %o0 to %o5 (interestingly, the docs I have, namely SCD 2.4.1,
appear to contain a typo, they say "%i0 to %i5" but this makes no sense).
The compiler obeys this rule, except when it decides to pass a complex FP
argument partially in registers and on the stack. It uses SPARC_FP_ARG_MAX
instead of SPARC_INT_ARG_MAX to determine where to split, so it ends up
loading something into %o6, a.k.a %sp the stack pointer.
The patch eliminates the crashes in the two compat tests that are still
failing on SPARC64. The remaining failures will be purely argument
mismatches, due to the funny convention used to pass complex integral
values. The patch also corrects some nits in the header.
Bootstrapped/regtested on sparc64-sun-solaris2.9 (c,c++,objc,f77).
--
Eric Botcazou
2003-07-03 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.c (function_arg_partial_nregs): Use
SPARC_INT_ARG_MAX to determine where to split unnamed
complex FP arguments.
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.251
diff -u -p -r1.251 sparc.c
--- config/sparc/sparc.c 27 Jun 2003 09:49:44 -0000 1.251
+++ config/sparc/sparc.c 2 Jul 2003 06:36:58 -0000
@@ -1,8 +1,8 @@
-/* Subroutines for insn-output.c for Sun SPARC.
+/* Subroutines for insn-output.c for SPARC.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
- 64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
+ 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
at Cygnus Support.
This file is part of GCC.
@@ -5074,7 +5074,7 @@ function_arg_partial_nregs (cum, mode, t
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
|| (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
- && ! TARGET_FPU))
+ && ! (TARGET_FPU && named)))
{
if (GET_MODE_ALIGNMENT (mode) == 128)
{