[patch] Fix m32c breakage caused by fix for PR 32773

Richard Guenther richard.guenther@gmail.com
Thu Jul 19 19:13:00 GMT 2007


On 7/19/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> 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.

This is ok.

Thanks,
Richard.
>
> 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.  */
>



More information about the Gcc-patches mailing list