This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] fix .DOT file generation for IPA passes


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?

Attachment: curr
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]