On 11/20/2017 02:10 PM, Jakub Jelinek wrote:
> Hi!
>
> The dwarf2out.c code relies on the assembly_start debug hook being
> invoked before any RTL is processed from final.c (and needs it to be
> done just once). Normally it is called from cgraphunit.c, but when
> __RTL is seen with a starting pass, run_rtl_passes is called already
> from the FE. While it would be better to defer the rtl finalization
> until cgraph says so, it might be quite hard, so instead this patch
> hacks dwarf2out_assembly_start so that it can be invoked multiple times
> (and does nothing on the 2nd+ call) and invokes it from the run_rtl_passes
> function too.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-11-20 Jakub Jelinek <ja...@redhat.com>
>
> PR debug/82933
> * run-rtl-passes.c: Include debug.h.
> (run_rtl_passes): Call debug_hooks->assembly_start.
> * dwarf2out.c (dwarf2out_assembly_start): Return early if invoked
> multiple times.
>
> * gcc.dg/rtl/x86_64/pr82933.c: New test.
OK.
jeff