[patch] fix .DOT file generation for IPA passes

Richard Biener richard.guenther@gmail.com
Wed Dec 18 11:42:00 GMT 2013


On Tue, Dec 17, 2013 at 9:10 PM, Aldy Hernandez <aldyh@redhat.com> wrote:
> I was trying to generate a graph file with
> -fdump-ipa-tmipa-blocks-details-vops-graph, but the .dot file was corrupted.
> It looks like the header bits printed in start_graph_dump() are not dumped
> because we are predicating the calls to
> clean_graph_dump_file->start_graph_dump by:
>
>           && cfun && (cfun->curr_properties & PROP_cfg))
>
> The problem is that for IPA passes (well at least for tmipa) cfun is NULL so
> we don't initialize the dump file, but later we go through each function
> (setting cfun appropriately) and dump the corresponding graphs somewhere in:
>
>     do_per_function (execute_function_dump, NULL);
>
> I have fixed this by adding a bit in opt_pass to keep track of if a graph
> .DOT file has been initialized, and initialize it if not.  I suppose we
> could move initialization of the graph file further down, but that seemed a
> bit more tedious given all the places where we dump.
>
> OK?

Ok.

Thanks,
Richard.



More information about the Gcc-patches mailing list