This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: pass outgoing float arguments in both floating and general registers in indirect calls using 32 bit ABI


> Floating arguments should be passed in both general and floating registers
> in indirect ($$dyncall) calls in the 32 bit ABI when using the HP assembler.
> The reason is there is no way to specify argument locations in static
> functions when the HP assembler is used.  The ABI requires that arguments
> in indirect calls be passed in general registers.  However, the default
> location is in the floating registers and this is where a static function
> expects floating arguments.  This change makes gcc consist in its behaviour
> with the HP compiler.
> 
> Bootstrap checked with both gnu and HP assembler on hppa1.1-hp-hpux10.20.
> 
> OK?
> 

Oops.

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-09-05  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* pa.c (function_arg): Pass floating arguments in both general and
	floating registers in indirect (dynamic) calls when generating code
	for the 32 bit ABI and the HP assembler.

--- pa.c.orig	Wed Aug 22 13:32:28 2001
+++ pa.c	Wed Sep  5 15:48:47 2001
@@ -7145,22 +7145,30 @@
 					 gen_rtx_REG (DImode, gpr_reg_base),
 					 GEN_INT (8))));
     }
-  /* Determine if the register needs to be passed in both general and
+  /* Determine if the argument needs to be passed in both general and
      floating point registers.  */
-  if ((TARGET_PORTABLE_RUNTIME || TARGET_64BIT || TARGET_ELF32)
-      /* If we are doing soft-float with portable runtime, then there
-	 is no need to worry about FP regs.  */
-      && ! TARGET_SOFT_FLOAT
-      /* The parameter must be some kind of float, else we can just
-	 pass it in integer registers.  */
-      && FLOAT_MODE_P (mode)
-      /* The target function must not have a prototype.  */
-      && cum->nargs_prototype <= 0
-      /* libcalls do not need to pass items in both FP and general
-	 registers.  */
-      && type != NULL_TREE
-      /* All this hair applies to outgoing args only.  */
-      && !incoming)
+  if (((TARGET_PORTABLE_RUNTIME || TARGET_64BIT || TARGET_ELF32)
+       /* If we are doing soft-float with portable runtime, then there
+	  is no need to worry about FP regs.  */
+       && ! TARGET_SOFT_FLOAT
+       /* The parameter must be some kind of float, else we can just
+	  pass it in integer registers.  */
+       && FLOAT_MODE_P (mode)
+       /* The target function must not have a prototype.  */
+       && cum->nargs_prototype <= 0
+       /* libcalls do not need to pass items in both FP and general
+	  registers.  */
+       && type != NULL_TREE
+       /* All this hair applies to outgoing args only.  */
+       && ! incoming)
+      /* Also pass outgoing floating arguments in both registers in indirect
+	 calls with the 32 bit ABI and the HP assembler since there is no
+	 way to the specify argument locations in static functions.  */
+      || (! TARGET_64BIT
+	  && ! TARGET_GAS
+	  && ! incoming
+	  && cum->indirect
+	  && FLOAT_MODE_P (mode)))
     {
       retval
 	= gen_rtx_PARALLEL


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]