re PR debug/41439 (choose DW_OP_stack_value over DW_OP_implicit_value more often, please)

PR debug/41439
	* dwarf2out.c (address_of_int_loc_descriptor): Don't emit
	DW_OP_piece after DW_OP_stack_value, adjust size calculations
	for it, when DW_OP_stack_value and DW_OP_implicit_value has
	the same size, prefer DW_OP_stack_value.
	(loc_descriptor, loc_list_for_address_of_addr_expr_of_indirect_ref,
	loc_list_from_tree): Don't emit DW_OP_piece after DW_OP_stack_value.

From-SVN: r152091
This commit is contained in:
Jakub Jelinek 2009-09-23 20:07:07 +02:00 committed by Jakub Jelinek
parent 7168dc4708
commit abab57efc6
2 changed files with 15 additions and 21 deletions

View File

@ -1,3 +1,13 @@
2009-09-23 Jakub Jelinek <jakub@redhat.com>
PR debug/41439
* dwarf2out.c (address_of_int_loc_descriptor): Don't emit
DW_OP_piece after DW_OP_stack_value, adjust size calculations
for it, when DW_OP_stack_value and DW_OP_implicit_value has
the same size, prefer DW_OP_stack_value.
(loc_descriptor, loc_list_for_address_of_addr_expr_of_indirect_ref,
loc_list_from_tree): Don't emit DW_OP_piece after DW_OP_stack_value.
2009-09-23 Alexandre Oliva <aoliva@redhat.com>
PR debug/41353

View File

@ -10941,17 +10941,14 @@ address_of_int_loc_descriptor (int size, HOST_WIDE_INT i)
}
/* Determine if DW_OP_stack_value or DW_OP_implicit_value
is more compact. For DW_OP_stack_value we need:
litsize + 1 (DW_OP_stack_value) + 1 (DW_OP_bit_size)
+ 1 (mode size)
litsize + 1 (DW_OP_stack_value)
and for DW_OP_implicit_value:
1 (DW_OP_implicit_value) + 1 (length) + mode_size. */
if ((int) DWARF2_ADDR_SIZE >= size
&& litsize + 1 + 1 + 1 < 1 + 1 + size)
1 (DW_OP_implicit_value) + 1 (length) + size. */
if ((int) DWARF2_ADDR_SIZE >= size && litsize + 1 <= 1 + 1 + size)
{
loc_result = int_loc_descriptor (i);
add_loc_descr (&loc_result,
new_loc_descr (DW_OP_stack_value, 0, 0));
add_loc_descr_op_piece (&loc_result, size);
return loc_result;
}
@ -11997,11 +11994,8 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
/* Value expression. */
loc_result = mem_loc_descriptor (rtl, VOIDmode, initialized);
if (loc_result)
{
add_loc_descr (&loc_result,
new_loc_descr (DW_OP_stack_value, 0, 0));
add_loc_descr_op_piece (&loc_result, GET_MODE_SIZE (mode));
}
add_loc_descr (&loc_result,
new_loc_descr (DW_OP_stack_value, 0, 0));
}
break;
}
@ -12391,11 +12385,6 @@ loc_list_for_address_of_addr_expr_of_indirect_ref (tree loc, bool toplev)
loc_list_plus_const (list_ret, bytepos);
add_loc_descr_to_each (list_ret,
new_loc_descr (DW_OP_stack_value, 0, 0));
add_loc_descr_to_each (list_ret,
new_loc_descr (DW_OP_piece,
int_size_in_bytes (TREE_TYPE
(loc)),
0));
}
return list_ret;
}
@ -12916,11 +12905,6 @@ loc_list_from_tree (tree loc, int want_address)
}
add_loc_descr_to_each (list_ret,
new_loc_descr (DW_OP_stack_value, 0, 0));
add_loc_descr_to_each (list_ret,
new_loc_descr (DW_OP_piece,
int_size_in_bytes (TREE_TYPE
(loc)),
0));
have_address = 1;
}
/* Show if we can't fill the request for an address. */