summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/reg-stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/reg-stack.c')
-rw-r--r--contrib/gcc/reg-stack.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/gcc/reg-stack.c b/contrib/gcc/reg-stack.c
index 9a6c89b..0f284ac 100644
--- a/contrib/gcc/reg-stack.c
+++ b/contrib/gcc/reg-stack.c
@@ -1060,10 +1060,21 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
if (regstack->reg[i] == REGNO (src))
break;
- /* The source must be live, and the dest must be dead. */
- if (i < 0 || get_hard_regnum (regstack, dest) >= FIRST_STACK_REG)
+ /* The destination must be dead, or life analysis is borked. */
+ if (get_hard_regnum (regstack, dest) >= FIRST_STACK_REG)
abort ();
+ /* If the source is not live, this is yet another case of
+ uninitialized variables. Load up a NaN instead. */
+ if (i < 0)
+ {
+ PATTERN (insn) = pat
+ = gen_rtx_SET (VOIDmode,
+ FP_MODE_REG (REGNO (dest), SFmode), nan);
+ INSN_CODE (insn) = -1;
+ return move_for_stack_reg (insn, regstack, pat);
+ }
+
/* It is possible that the dest is unused after this insn.
If so, just pop the src. */
OpenPOWER on IntegriCloud