+2011-06-14 Richard Henderson <rth@redhat.com>
+
+ PR debug/48459
+ * dwarf2out.c (frame_pointer_fb_offset_valid): New.
+ (based_loc_descr): Assert it's true.
+ (compute_frame_pointer_to_fb_displacement): Set it, rather than
+ aborting immediately.
+
2011-06-14 Sanjin Liu <scliu@faraday-tech.com>
Mingfeng Wu <mingfeng@faraday-tech.com>
/* Offset from the "steady-state frame pointer" to the frame base,
within the current function. */
static HOST_WIDE_INT frame_pointer_fb_offset;
+static bool frame_pointer_fb_offset_valid;
static VEC (dw_die_ref, heap) *base_types;
return new_reg_loc_descr (base_reg, offset);
}
+ gcc_assert (frame_pointer_fb_offset_valid);
offset += frame_pointer_fb_offset;
return new_loc_descr (DW_OP_fbreg, offset, 0);
}
elim = XEXP (elim, 0);
}
- gcc_assert ((SUPPORTS_STACK_ALIGNMENT
- && (elim == hard_frame_pointer_rtx
- || elim == stack_pointer_rtx))
- || elim == (frame_pointer_needed
- ? hard_frame_pointer_rtx
- : stack_pointer_rtx));
-
frame_pointer_fb_offset = -offset;
+
+ /* ??? AVR doesn't set up valid eliminations when there is no stack frame
+ in which to eliminate. This is because it's stack pointer isn't
+ directly accessible as a register within the ISA. To work around
+ this, assume that while we cannot provide a proper value for
+ frame_pointer_fb_offset, we won't need one either. */
+ frame_pointer_fb_offset_valid
+ = ((SUPPORTS_STACK_ALIGNMENT
+ && (elim == hard_frame_pointer_rtx
+ || elim == stack_pointer_rtx))
+ || elim == (frame_pointer_needed
+ ? hard_frame_pointer_rtx
+ : stack_pointer_rtx));
}
/* Generate a DW_AT_name attribute given some string value to be included as