https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61456

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm.

This is running into nonoverlapping_component_refs_of_decl_p which has

(gdb) p field1
$32 = <field_decl 0x7ffff6d7f8e8 __delta>
(gdb) p field2
$33 = <field_decl 0x7ffff6d7f720 __delta>

but they are clearly on the same offset and have the same size.  They
are members of different types (but same TYPE_MAIN_VARIANT) and appearantly
the TYPE_FIELDs of the variants are not shared.

So appearantly it is not safe to drop to TYPE_MAIN_VARIANT here (and in
nonoverlapping_component_refs_p).  But it's also not necessary - if the
TYPE_FILEDs are shared then the DECL_FIELD_CONTEXT of course points to the
same type already.

Reply via email to