https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63226
Bug ID: 63226 Summary: ICE with -flto-odr-type-merging Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: hubicka at gcc dot gnu.org The ICE depends on Honza's no-yet committed patch: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00878.html With that patch (and hence -flto-odr-type-merging), one gets the following ICE: $ g++ -c -flto one12.ii two10.ii $ g++ -flto -flto-odr-type-merging one12.o two10.ii lto1: internal compiler error: in odr_types_equivalent_p, at ipa-devirt.c:1066 0x815714 odr_types_equivalent_p ../../gcc/ipa-devirt.c:1066 0x815a3e add_type_duplicate ../../gcc/ipa-devirt.c:1116 Note: -Wodr doesn't warn for this test case. With the files one12.ii: ---------------------------------------- class ONE; class OneClass { ONE *swpmi; OneClass (); }; typedef struct ynodetype_t *ynode; typedef struct ynodetype_t { union { struct { ynode child1, child3; } i; } y; } ynodetype; class ONE { union _xynode { ynode yn; } ; }; OneClass::OneClass () { } ---------------------------------------- two10.ii: ---------------------------------------- class ONE; class TwoClass { ONE *swpci; TwoClass (); }; typedef struct ynodetype_t *ynode; typedef struct { } yleaftype; typedef struct ynodetype_t { union { struct { yleaftype leaf; } i; } y; } ynodetype; typedef ynode ytree; class ONE { ytree Tree; }; TwoClass::TwoClass () { } ----------------------------------------