[PATCH] Two DW_OP_GNU_variable_value fixes / tweaks

Richard Biener richard.guenther@gmail.com
Tue May 16 11:10:00 GMT 2017


On Mon, May 15, 2017 at 3:19 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, May 15, 2017 at 02:43:43PM +0200, Richard Biener wrote:
>>
>> While bringing early LTO debug up-to-speed I noticed the following two
>> issues.  The first patch avoids useless work in
>> note_variable_value_in_expr and actually makes use of the DIE we
>> eventually create in resolve_variable_value_in_expr.
>>
>> The second avoids generating a DW_OP_GNU_variable_value for a decl
>> we'll never have a DIE for -- this might be less obvious than the
>> other patch but I think we'll also never have any other debug info
>> we can resolve the decl with(?)
>>
>> Bootstrapped and tested the first patch sofar
>> on x86_64-unknown-linux-gnu, 2nd is pending.
>>
>> Ok?
>>
>> Thanks,
>> Richard.
>>
>> 2017-05-15  Richard Biener  <rguenther@suse.de>
>>
>>       * dwarf2out.c (resolve_variable_value_in_expr): Lookup DIE
>>       just generated.
>>       (note_variable_value_in_expr): If we resolved the decl ref
>>       do not push to the stack.
>
> LGTM.
>
>> 2017-05-15  Richard Biener  <rguenther@suse.de>
>>
>>       * dwarf2out.c (loc_list_from_tree_1): Do not create
>>       DW_OP_GNU_variable_value for DECL_IGNORED_P decls.
>
> Can you verify it e.g. in a bootstrapped cc1plus doesn't change the debug info
> (except for dwarf2out.o itself)?
> It looks reasonable and it would surprise me if did, just want to be sure.

Done.  Note it only happened for Ada.

Richard.

>         Jakub



More information about the Gcc-patches mailing list