While testing the altest iteration of shrink-wrapping on mips-elf, a new
failure showed up in gcc.dg/pr43139.c. When restoring floating-point
registers, we attach REG_CFA_RESTORE notes for DFmode registers, but the
dwarf2cfi code only records a single regno for such a multiword hard reg.
Fixed with this patch, tested with shrink-wrapping on mips-elf (default
multilib plus two with -mips16). Ok?
Bernd
* dwarf2cfi.c (dwarf2out_frame_debug_cfa_expression): Handle
multi-word registers.
Index: gcc/dwarf2cfi.c
===================================================================
--- gcc/dwarf2cfi.c (revision 178734)
+++ gcc/dwarf2cfi.c (working copy)
@@ -1236,10 +1236,15 @@ dwarf2out_frame_debug_cfa_expression (rt
static void
dwarf2out_frame_debug_cfa_restore (rtx reg)
{
- unsigned int regno = dwf_regno (reg);
+ unsigned int orig_regno = REGNO (reg);
+ int nregs = hard_regno_nregs[orig_regno][GET_MODE (reg)];
+ while (nregs-- > 0)
+ {
+ unsigned int regno = DWARF_FRAME_REGNUM (orig_regno + nregs);
- add_cfi_restore (regno);
- update_row_reg_save (cur_row, regno, NULL);
+ add_cfi_restore (regno);
+ update_row_reg_save (cur_row, regno, NULL);
+ }
}
/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_WINDOW_SAVE.