This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Fix m32c breakage caused by fix for PR 32773
Hello,
> > The patch below makes us create a forwarder block in case exit has
> > several fallthru predecessors. Bootstrapped & regtested on i686.
>
> It breaks on m32c-unknown-elf:
when an epilogue is inserted, a fallthru to texit may be converted
to a non-fallthru edge. However, we keep the EDGE_FALLTHRU flag on
the exit edges. force_one_exit_fallthru then may try to redirect such
edges, thus causing this ICE.
The fix is to clean up the fallthru flag from the exit edges.
Bootstrapped & regtested on i686.
Zdenek
* function.c (thread_prologue_and_epilogue_insns): Fix exit
predecessor fallthru flags.
Index: function.c
===================================================================
*** function.c (revision 126718)
--- function.c (working copy)
*************** thread_prologue_and_epilogue_insns (void
*** 5256,5262 ****
epilogue_done:
if (inserted)
! commit_edge_insertions ();
#ifdef HAVE_sibcall_epilogue
/* Emit sibling epilogues before any sibling call sites. */
--- 5256,5273 ----
epilogue_done:
if (inserted)
! {
! commit_edge_insertions ();
!
! /* The epilogue insns we inserted may cause the exit edge to no longer
! be fallthru. */
! FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
! {
! if (((e->flags & EDGE_FALLTHRU) != 0)
! && returnjump_p (BB_END (e->src)))
! e->flags &= ~EDGE_FALLTHRU;
! }
! }
#ifdef HAVE_sibcall_epilogue
/* Emit sibling epilogues before any sibling call sites. */