Bug 41439 - choose DW_OP_stack_value over DW_OP_implicit_value more often, please
Summary: choose DW_OP_stack_value over DW_OP_implicit_value more often, please
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.5.0
: P3 enhancement
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-22 21:30 UTC by Roland McGrath
Modified: 2010-05-24 09:01 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-09-23 08:51:05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland McGrath 2009-09-22 21:30:51 UTC
The comment in address_of_int_loc_descriptor doesn't make a lot of sense to me.  In any case of a value no larger than address size, you can use DW_OP_stack_value to get the same size or smaller.  When the size is the same, such as DW_OP_implicit_value(address-sized block) vs DW_OP_addr(address-consant) DW_OP_stack_value (both address-size + 2 bytes), I think DW_OP_stack_value is preferable because consumers do not have to involve overly-general variable-sized-stuff-with-relocs logic that the general case of constant blocks involves.  There is no need for a DW_OP_{bit_,}piece in these cases when the expressed value is in the low bits of the value computed on the stack.
Comment 2 Jakub Jelinek 2009-09-23 18:07:35 UTC
Subject: Bug 41439

Author: jakub
Date: Wed Sep 23 18:07:07 2009
New Revision: 152091

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152091
Log:
	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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c

Comment 3 Jakub Jelinek 2010-05-24 09:01:45 UTC
Fixed.