From: Chung-Lin Tang Date: Wed, 23 Nov 2011 13:22:30 +0000 (+0000) Subject: re PR rtl-optimization/50496 (ICE in redirect_jump, at jump.c:1497) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1ab2759ab326ae20cd0023c4e0873e16517cc49;p=gcc.git re PR rtl-optimization/50496 (ICE in redirect_jump, at jump.c:1497) 2011-11-23 Chung-Lin Tang PR rtl-optimization/50496 * jump.c (redirect_jump): Assert fail on nlabel == NULL_RTX only after epilogue is created. Add comments. From-SVN: r181664 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index abd83806d00..4e574a03086 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-11-23 Chung-Lin Tang + + PR rtl-optimization/50496 + * jump.c (redirect_jump): Assert fail on nlabel == NULL_RTX + only after epilogue is created. Add comments. + 2011-11-22 Richard Henderson * config/ia64/ia64.c (ia64_expand_atomic_op): Add model parameter. diff --git a/gcc/jump.c b/gcc/jump.c index f852f827729..52cbbca43db 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1495,7 +1495,18 @@ redirect_jump (rtx jump, rtx nlabel, int delete_unused) { rtx olabel = JUMP_LABEL (jump); - gcc_assert (nlabel != NULL_RTX); + if (!nlabel) + { + /* If there is no label, we are asked to redirect to the EXIT block. + When before the epilogue is emitted, return/simple_return cannot be + created so we return 0 immediately. After the epilogue is emitted, + we always expect a label, either a non-null label, or a + return/simple_return RTX. */ + + if (!epilogue_completed) + return 0; + gcc_unreachable (); + } if (nlabel == olabel) return 1;