aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-06-14 06:31:43 -0700
committerRichard Henderson <rth@gcc.gnu.org>2011-06-14 06:31:43 -0700
commit40873cdd57493f0dca7a5842e5a141ef10504aff (patch)
treeaf26a993461004b04bd46635e26fcdd7f9a336b1 /gcc/dwarf2out.c
parent73e8cb24c2655ff316d58c559c082c8d1ef67ed9 (diff)
downloadgcc-40873cdd57493f0dca7a5842e5a141ef10504aff.zip
gcc-40873cdd57493f0dca7a5842e5a141ef10504aff.tar.gz
gcc-40873cdd57493f0dca7a5842e5a141ef10504aff.tar.bz2
re PR debug/48459 (avr: Assertion failure with -gdwarf-2)
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. From-SVN: r175018
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 776066b..c1c22b4 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -6471,6 +6471,7 @@ static GTY(()) VEC(tree,gc) *generic_type_instances;
/* 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;
@@ -13613,6 +13614,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
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);
}
@@ -18336,14 +18338,20 @@ compute_frame_pointer_to_fb_displacement (HOST_WIDE_INT offset)
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