Re: [PATCH] dwarf2out: Fix up field_byte_offset [PR101378]

2021-11-10 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 12:36:04PM +0100, Richard Biener wrote: > > I'm afraid I forgot the DECL_FIELD_OFFSET vs. DECL_FIELD_BIT_OFFSET stuff > > enough that I'm not sure what is the right fix for that case, maybe it would > > work if we dropped the && TREE_CODE (DECL_FIELD_OFFSET (decl)) == > > I

Re: [PATCH] dwarf2out: Fix up field_byte_offset [PR101378]

2021-11-10 Thread Richard Biener via Gcc-patches
On Wed, 10 Nov 2021, Jakub Jelinek wrote: > On Wed, Nov 10, 2021 at 10:52:42AM +0100, Richard Biener wrote: > > > The only thing I'm unsure about is whether the test should be > > > DECL_BIT_FIELD or DECL_BIT_FIELD_TYPE should be tested. I thought it > > > doesn't matter, but it seems stor-layout

Re: [PATCH] dwarf2out: Fix up field_byte_offset [PR101378]

2021-11-10 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 10:52:42AM +0100, Richard Biener wrote: > > The only thing I'm unsure about is whether the test should be > > DECL_BIT_FIELD or DECL_BIT_FIELD_TYPE should be tested. I thought it > > doesn't matter, but it seems stor-layout.c in some cases clears > > DECL_BIT_FIELD if their

Re: [PATCH] dwarf2out: Fix up field_byte_offset [PR101378]

2021-11-10 Thread Richard Biener via Gcc-patches
On Wed, 10 Nov 2021, Jakub Jelinek wrote: > Hi! > > For PCC_BITFIELD_TYPE_MATTERS field_byte_offset has quite large code > to deal with it since many years ago (see it e.g. in GCC 3.2, although it > used to be on HOST_WIDE_INTs, then on double_ints, now on offset_ints). > But that code apparently

Re: [PATCH] dwarf2out: Fix up field_byte_offset [PR101378]

2021-11-10 Thread Eric Botcazou via Gcc-patches
> I think Ada has bitfields of aggregate types, so CCing Eric, though > I'd hope it doesn't have bitfields where type size is smaller than > field decl size like C++ has. Assuming your sentence is written in the right sense :-) then, no, in Ada bit- fields always have DECL_SIZE (bf) <= TYPE_SIZE (

[PATCH] dwarf2out: Fix up field_byte_offset [PR101378]

2021-11-10 Thread Jakub Jelinek via Gcc-patches
Hi! For PCC_BITFIELD_TYPE_MATTERS field_byte_offset has quite large code to deal with it since many years ago (see it e.g. in GCC 3.2, although it used to be on HOST_WIDE_INTs, then on double_ints, now on offset_ints). But that code apparently isn't able to cope with members with empty class types