From: Richard Henderson Date: Mon, 13 Dec 2004 02:34:14 +0000 (-0800) Subject: re PR rtl-optimization/17186 (ICE in move_for_stack_reg, at reg-stack.c:1065) X-Git-Tag: releases/gcc-3.4.4~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=088acc9597a3e54bf2bf7a227df8cf22e90fccce;p=thirdparty%2Fgcc.git re PR rtl-optimization/17186 (ICE in move_for_stack_reg, at reg-stack.c:1065) PR rtl-opt/17186 * reg-stack.c (move_for_stack_reg): Handle source register not live with a nan. From-SVN: r92074 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5cb9677939bb..581e58e674eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-12-12 Richard Henderson + + PR rtl-opt/17186 + * reg-stack.c (move_for_stack_reg): Handle source register not + live with a nan. + 2004-12-12 Richard Henderson PR target/18932 diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 9a6c89bf310b..0f284ac5c53c 100644 --- a/gcc/reg-stack.c +++ b/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. */