On Mon, May 12, 2025 at 11:24 AM Eric Botcazou <botca...@adacore.com> wrote: > > Hi, > > the function accepts all handled_component_p expressions and decodes them by > means of get_inner_reference as expected, but bails out on bitfields: > > /* TODO: We can extract value of the small expression via shifting even > for nonzero bitpos. */ > if (list_ret == 0) > return 0; > if (!multiple_p (bitpos, BITS_PER_UNIT, &bytepos) > || !multiple_p (bitsize, BITS_PER_UNIT)) > { > expansion_failed (loc, NULL_RTX, > "bitfield access"); > return 0; > } > > This lifts the second part of the restriction, which helps for obscure cases > of packed discriminated record types in Ada, although this requires the latest > GDB sources. > > Tested on x86-64/Linux, OK for the mainline?
OK. Btw, can we try to add a "guality" for gnat.dg? Or are you making sure to add coverage to the gdb testsuite? Thanks, Richard. > > 2025-05-12 Eric Botcazou <ebotca...@adacore.com> > > * dwarf2out.cc (loc_list_from_tree_1) <COMPONENT_REF>: Do not bail > out when the size is not a multiple of a byte. > Deal with bit-fields whose size is not a multiple of a byte when > dereferencing an address. > > -- > Eric Botcazou