This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496
On 10/15/11 16:21, Eric Botcazou wrote:
> so the correct fix is very likely something like:
>
> Index: cfgrtl.c
> ===================================================================
> --- cfgrtl.c (revision 179844)
> +++ cfgrtl.c (working copy)
> @@ -1024,13 +1024,20 @@ patch_jump_insn (rtx insn, rtx old_label
>
> if (!currently_expanding_to_rtl || JUMP_LABEL (insn) == old_label)
> {
> + rtx new_label;
> +
> /* If the insn doesn't go where we think, we're confused. */
> gcc_assert (JUMP_LABEL (insn) == old_label);
>
> + if (new_bb == EXIT_BLOCK_PTR)
> + new_label = ret_rtx;
> + else
> + new_label = block_label (new_bb);
> +
> /* If the substitution doesn't succeed, die. This can happen
> if the back end emitted unrecognizable instructions or if
> target is exit block on some arches. */
> - if (!redirect_jump (insn, block_label (new_bb), 0))
> + if (!redirect_jump (insn, new_label, 0))
> {
> gcc_assert (new_bb == EXIT_BLOCK_PTR);
> return false;
>
>
> Bernd, should all the callers of redirect_jump/redirect_jump_1 be audited for
> this pattern (there are 3 of them in cfgrtl.c for example)?
I think first we'll need to find the caller and make sure it really
wants a return and not a simple_return.
Bernd