re PR debug/40659 (A simple struct member offset doesn't need a full dwarf location expression)

2009-07-08  Mark Wielaard  <mjw@redhat.com>

	PR debug/40659
	* dwarf2out.c (add_data_member_location_attribute): When we have
	only a constant offset don't emit a new location description using
	DW_OP_plus_uconst, but just add the constant with add_AT_int, when
	dwarf_version > 2.

From-SVN: r149377
This commit is contained in:
Mark Wielaard 2009-07-08 18:07:47 +00:00 committed by Mark Wielaard
parent ac2e563fcf
commit 3d78d293d4
2 changed files with 30 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2009-07-08 Mark Wielaard <mjw@redhat.com>
PR debug/40659
* dwarf2out.c (add_data_member_location_attribute): When we have
only a constant offset don't emit a new location description using
DW_OP_plus_uconst, but just add the constant with add_AT_int, when
dwarf_version > 2.
2009-07-08 Richard Henderson <rth@redhat.com>
PR target/38900

View File

@ -11475,22 +11475,31 @@ add_data_member_location_attribute (dw_die_ref die, tree decl)
if (! loc_descr)
{
enum dwarf_location_atom op;
/* The DWARF2 standard says that we should assume that the structure
address is already on the stack, so we can specify a structure field
address by using DW_OP_plus_uconst. */
if (dwarf_version > 2)
{
/* Don't need to output a location expression, just the constant. */
add_AT_int (die, DW_AT_data_member_location, offset);
return;
}
else
{
enum dwarf_location_atom op;
/* The DWARF2 standard says that we should assume that the structure
address is already on the stack, so we can specify a structure
field address by using DW_OP_plus_uconst. */
#ifdef MIPS_DEBUGGING_INFO
/* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst
operator correctly. It works only if we leave the offset on the
stack. */
op = DW_OP_constu;
/* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst
operator correctly. It works only if we leave the offset on the
stack. */
op = DW_OP_constu;
#else
op = DW_OP_plus_uconst;
op = DW_OP_plus_uconst;
#endif
loc_descr = new_loc_descr (op, offset, 0);
loc_descr = new_loc_descr (op, offset, 0);
}
}
add_AT_loc (die, DW_AT_data_member_location, loc_descr);