This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Illegible dumps with dump_cfg_function_to_file
Hello,
> > > Why did you introduce this new function instead of using
> > > dump_function_to_file?
> >
> > Because it no longer works after cfg creation (or perhaps it does just
> > now, but will not quite soon, and it anyway seems better to me to use
> > an intermediate-represenation independent solution).
> >
> Which is what dump_function_to_file should be. To get consistent
> visuals, we need to have a single point of entry to the dumpers.
> dump_function_to_file should be able to tell whether the function has
> been hacked into basic blocks. We should not have two different
> function dumpers. There's going to be code duplication problems and
> visual consistency problems, making it hard to diff between different
> passes.
OK, but IMHO the right way is what dump_cfg_function_to_file does, since
it is infrastructure independent. dump_function_to_file is only useful
before we switch to cfg based representation.
> There's something else wrong with dump_cfg_function_to_file. It is not
> guaranteed to dump the function in program order. It should walk down
> the dominator tree, not traverse the blocks linearly.
this actually is not a bug in the function, but in the basic block
ordering. The order of basic blocks should be the same as the order of
the code. I have sent a fix for this together with the cfg-aware
remove_useless_... patch (I may send it as a separate patch if you
prefer).
Zdenek