> @@ -6557,7 +6558,7 @@ rest_of_handle_thread_prologue_and_epilogue
> (function *fun)
> {
> /* prepare_shrink_wrap is sensitive to the block structure of the
> control
> flow graph, so clean it up first. */
> - if (optimize)
> + if (cfun->tail_call_marked || optimize)
> cleanup_cfg (0);
>
> /* On some machines, the prologue and epilogue code, or parts
> thereof,
> @@ -6579,7 +6580,7 @@ rest_of_handle_thread_prologue_and_epilogue
> (function *fun)
>
> /* Shrink-wrapping can result in unreachable edges in the epilogue,
> see PR57320. */
> - cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
> + cleanup_cfg ((cfun->tail_call_marked || optimize) ? CLEANUP_EXPENSIVE
> : 0);
>
> I think this makes -g -O0 with musttail useless. Make sure if you have a
> musttail function call in the ir that it does not change the cfg for -O0
> case which adds extra jumps specifically for debugging.
It looks like the second hunk (CLEANUP_EXPENSIVE) is not actually
needed. I just tested and at least ARM works without it. I will drop it.
But the first one is needed.
Do you still have the concern only with the first? AFAIK without
CLEANUP_EXPENSIVE there will be much less changes to branches.
-Andi