This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Revert controversial apply_{args,result}_size change
> I still don't think this defect rises to the level of a showstopper, but
> certainly the barrier to including a SPARC-specific patch is lower than
> a change to generic code.
The minimal patch that only undoes the breakage. Tested on
sparc-sun-solaris2.7 by rebuilding and testing libobjc, and on the 7
testcases mentioning __builtin_apply.
I'll add it to the wiki once I've figured out how to do it. :-)
* config/sparc/sparc.md (untyped_call): Save the registers manually.
--
Eric Botcazou
Index: config/sparc/sparc.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.md,v
retrieving revision 1.226
diff -u -p -r1.226 sparc.md
--- config/sparc/sparc.md 18 Jan 2005 22:54:47 -0000 1.226
+++ config/sparc/sparc.md 10 Apr 2005 21:58:47 -0000
@@ -7626,21 +7626,22 @@
(define_expand "untyped_call"
[(parallel [(call (match_operand 0 "" "")
(const_int 0))
- (match_operand 1 "" "")
+ (match_operand:BLK 1 "memory_operand" "")
(match_operand 2 "" "")])]
""
{
- int i;
+ rtx valreg1 = gen_rtx_REG (DImode, 8);
+ rtx valreg2 = gen_rtx_REG (TARGET_ARCH64 ? TFmode : DFmode, 32);
+ rtx result = operands[1];
/* Pass constm1 to indicate that it may expect a structure value, but
we don't know what size it is. */
emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, constm1_rtx));
- for (i = 0; i < XVECLEN (operands[2], 0); i++)
- {
- rtx set = XVECEXP (operands[2], 0, i);
- emit_move_insn (SET_DEST (set), SET_SRC (set));
- }
+ /* Save the function value registers. */
+ emit_move_insn (adjust_address (result, DImode, 0), valreg1);
+ emit_move_insn (adjust_address (result, TARGET_ARCH64 ? TFmode : DFmode, 8),
+ valreg2);
/* The optimizer does not know that the call sets the function value
registers we stored in the result block. We avoid problems by