On Thu, 2016-10-20 at 16:11 +0200, Bernd Schmidt wrote: > On 10/20/2016 03:55 PM, David Malcolm wrote: > > Currently the jump insn in question looks like this: > > > > (cjump_insn (set (pc) > > (label_ref 20)) > > (nil)) > > > > With explicit INSN_UIDs it would look like this: > > > > (cjump_insn 13 (set (pc) > > (label_ref 20)) > > (nil)) > > Yeah, that wouldn't be so bad. It would also make it easier to make a > -fdump-rtl-compact flag that changes the debugging dumps to use the > compact format (we'd still need slightly different output for > pseudos). > > Still, I'd like to again encourage a mechanism where we can emit > before/after dumps and have the compiler automatically compare them > when > running the test. That wouldn't run into this particular issue.
What kind of comparison would it do? I'd be wary about a purely textual comparison (e.g. "diff") - it would likely lead to fragile test cases, where minor changes to the output format mean that all the test cases need regenerating (mea culpa, I made this mistake in gcc-python-plugin's testsuite). So presumably the comparison would involve loading the "expected-after" version of the function, and doing some kind of function-level comparison on the parsed result. This sounds plausible, but would likely be a significant expansion of the scope of the project, since the existing RTL code is full of singleton global state (e.g. "crtl" aka x_rtl). So I'd prefer to leave this idea as a followup (and to implement the "explicit INSN_UIDs for everything" idea).