On Tue, Feb 05, 2013 at 06:18:39PM -0500, David Miller wrote: > Hello Eric, this is in regards to your HAVE_window_save code in > var-tracking.c and elsewhere added for PR target/48220. > > I'm trying to fix all of the guality failures on sparc and this issue > below is the first one I was able to comprehend. > > All of this special register window debugging handling in > var-tracking.c can get tripped up any time we have a leaf function, in > fact I would venture that most if not all of the guality failures on > sparc are directly or indirectly related to this issue.
Please see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54402#c21 , I really think the window save insn pattern should explicitly say what exactly it does, then the hack for it in var-tracking.c wouldn't be needed. As for leaf reg renumbering, IMHO rather than clutter all of var-tracking.c with it, just do the leaf renumbering in var-tracking.c (adjust_insn) or functions it calls, using validate_change. adjust_insn performs many other changes to the insns, transforming them from the way they should look like for code generation into a shape where they look like what is relevant to debug info. I guess leaf reg remapping is just another change of that kind. The way var-tracking works is that cselib is then called on the modified insn, and finally all the changes to the insn are rejected, reverting to the original. BTW, some guality testcase failures are there on every target (but usually different), the guality testcase results should simply be always compared to previous runs, so achieving zero failures might be too hard, and certainly not 4.8 material, but at least analysing the reasons why tests fail and fixing what is easily possible is definitely appreciated. Jakub