Message ID | 20130207.143818.353212301060219220.davem@davemloft.net |
---|---|
State | New |
Headers | show |
On Thu, Feb 07, 2013 at 02:38:18PM -0500, David Miller wrote: > The fix for this is trivial, just a missing leaf renumbering in dwarf2out.c: > > diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c > index 06cfb18..765d5c5 100644 > --- a/gcc/dwarf2out.c > +++ b/gcc/dwarf2out.c > @@ -10864,7 +10864,16 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset, > } > } > > - regno = DWARF_FRAME_REGNUM (REGNO (reg)); > + regno = REGNO (reg); > +#ifdef LEAF_REG_REMAP > + if (crtl->uses_only_leaf_regs) > + { > + int leaf_reg = LEAF_REG_REMAP (regno); > + if (leaf_reg != -1) > + regno = (unsigned) leaf_reg; > + } > +#endif > + regno = DWARF_FRAME_REGNUM (regno); > > if (!optimize && fde > && (fde->drap_reg == regno || fde->vdrap_reg == regno)) This and earlier patch are ok, if it bootstraps/regtests fine, and suitable ChangeLog entry is provided. Running gdb testsuite before and after wouldn't hurt though. Jakub
From: Jakub Jelinek <jakub@redhat.com> Date: Thu, 7 Feb 2013 20:43:32 +0100 > This and earlier patch are ok, if it bootstraps/regtests fine, and suitable > ChangeLog entry is provided. > Running gdb testsuite before and after wouldn't hurt though. I've done all of this, and committed to trunk and the gcc-4.7 branch, thanks. In looking at the remaining failures, several have to do with an early clobber if the first incoming argument register. The issue is that this is where return values are placed, so we run into a situation where that incoming argument value can't be reconstituted in any way by the variable tracking code and thus gdb says that it has been optimized out. Many non-x86 cpus are going to run into this problem. For example, from pr36728-1.c: foo: save %sp, -96, %sp add %sp, -40, %sp mov 2, %g2 add %sp, 123, %g1 mov 25, %g4 and %g1, -32, %g1 sethi %hi(b), %g3 st %g2, [%g1] ld [%fp+92], %g2 nop ld [%g1], %i0 add %g2, 14, %g2 and %g2, -8, %g2 sub %sp, %g2, %sp stb %g4, [%sp+96] add %sp, 96, %g2 sethi %hi(a), %g4 nop return %i7+8 nop Here %i0 is written early, and then the tests can't view 'arg1' properly later in the function. Also, I noticed that calculation of the on-stack address of values with alignment regressed in gcc-4.8 vs. gcc-4.7 Again, in pr36728-1.c, 'y' can be printed properly in gcc-4.7 but in gcc-4.8 it cannot. I think it might be getting the base register wrong, I'll look more deeply if I get a chance.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 06cfb18..765d5c5 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -10864,7 +10864,16 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset, } } - regno = DWARF_FRAME_REGNUM (REGNO (reg)); + regno = REGNO (reg); +#ifdef LEAF_REG_REMAP + if (crtl->uses_only_leaf_regs) + { + int leaf_reg = LEAF_REG_REMAP (regno); + if (leaf_reg != -1) + regno = (unsigned) leaf_reg; + } +#endif + regno = DWARF_FRAME_REGNUM (regno); if (!optimize && fde && (fde->drap_reg == regno || fde->vdrap_reg == regno))