[patch] Fix regression in debug info for Ada with DWARF 5

Eric Botcazou botcazou@adacore.com
Mon Aug 16 10:25:44 GMT 2021


add_scalar_info can directly generate a reference to an existing DIE for a 
scalar attribute, e.g the upper bound of a VLA, but it does so only if this 
existing DIE has a location or is a constant:

 	      if (get_AT (decl_die, DW_AT_location)
 		  || get_AT (decl_die, DW_AT_data_member_location)
 		  || get_AT (decl_die, DW_AT_const_value))

Now, in DWARF 5, members of a structure that are bitfields no longer have a 
DW_AT_data_member_location but a DW_AT_data_bit_offset attribute instead, so 
the condition is bypassed.

Tested on x86-64/Linux, OK for mainline and 11 branch?

2021-08-16  Eric Botcazou  <ebotcazou@adacore.com>

	* dwarf2out.c (add_scalar_info): Deal with DW_AT_data_bit_offset.

Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 476 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210816/857f3279/attachment.bin>

More information about the Gcc-patches mailing list