This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for gcc.c-torture/special/920520-1.c on powerpc
- To: egcs-patches at cygnus dot com
- Subject: Fix for gcc.c-torture/special/920520-1.c on powerpc
- From: Geoff Keating <geoffk at ozemail dot com dot au>
- Date: Tue, 25 Aug 1998 13:04:08 +1000
The problem is that assign_stack_temp is really not a good idea to
call during reload for a constant; it's also silly, because a SF
operand can easily be loaded directly into a GPR.
This probably isn't important enough to put in egcs 1.1 at this late
stage.
--
Geoffrey Keating <geoffk@ozemail.com.au>
===File ~/patches/egcs-4.diff===============================
Tue Aug 25 07:32:27 1998 Geoff Keating <geoffk@ozemail.com.au>
* config/rs6000/rs6000.md (movsf): Moves of const_double:SF to
GPRs don't, and shouldn't, go through memory.
--- config/rs6000/rs6000.md~ Sat Aug 22 13:21:28 1998
+++ config/rs6000/rs6000.md Tue Aug 25 07:34:16 1998
@@ -5740,7 +5740,7 @@
operand_subword (operands[1], 0, 0, SFmode));
DONE;
}
- else
+ else if (GET_CODE (operands[1]) != CONST_DOUBLE)
{
rtx stack_slot = assign_stack_temp (SFmode, 4, 0);
@@ -5748,16 +5748,16 @@
emit_move_insn (operands[0], stack_slot);
DONE;
}
+ /* else fall through. */
+ }
+ else if (CONSTANT_P (operands[1]))
+ {
+ operands[1] = force_const_mem (SFmode, operands[1]);
+ if (! memory_address_p (SFmode, XEXP (operands[1], 0))
+ && ! reload_in_progress)
+ operands[1] = change_address (operands[1], SFmode,
+ XEXP (operands[1], 0));
}
- }
-
- if (CONSTANT_P (operands[1]) && TARGET_HARD_FLOAT)
- {
- operands[1] = force_const_mem (SFmode, operands[1]);
- if (! memory_address_p (SFmode, XEXP (operands[1], 0))
- && ! reload_in_progress)
- operands[1] = change_address (operands[1], SFmode,
- XEXP (operands[1], 0));
}
}")
============================================================