]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/17186 (ICE in move_for_stack_reg, at reg-stack.c:1065)
authorRichard Henderson <rth@redhat.com>
Mon, 13 Dec 2004 02:34:14 +0000 (18:34 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 13 Dec 2004 02:34:14 +0000 (18:34 -0800)
        PR rtl-opt/17186
        * reg-stack.c (move_for_stack_reg): Handle source register not
        live with a nan.

From-SVN: r92074

gcc/ChangeLog
gcc/reg-stack.c

index 5cb9677939bb34ac183791f03802f4654a70fb2d..581e58e674eb9301e21bf58d75df0112eff9f505 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-12  Richard Henderson  <rth@redhat.com>
+
+        PR rtl-opt/17186
+        * reg-stack.c (move_for_stack_reg): Handle source register not
+       live with a nan.
+
 2004-12-12  Richard Henderson  <rth@redhat.com>
 
         PR target/18932
index 9a6c89bf310ba6b3bfc79d06ec49e808f800c528..0f284ac5c53cf6b6e144d8be0e21cbecf1e50926 100644 (file)
@@ -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.  */