https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65316
Bug ID: 65316 Summary: [5 Regression] LTO: Uninitialized memory / ICE with -g -fno-lto-odr-type-merging: in types_same_for_odr, at ipa-devirt.c:465 Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: ice-on-valid-code 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 Created attachment 34954 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34954&action=edit one.ii Follow up to PR65276 and PR65302. It turned out that is issue is due to uninitialized memory. Thus, if the last command succeeds, simply try again a couple of times (in delta, I called it up to 25 times) - or run it under valgrind or similar. It fails with the ICE: lto1: internal compiler error: in types_same_for_odr, at ipa-devirt.c:465 touch two.ii g++ -c -std=c++11 -g2 -fno-lto-odr-type-merging -flto -O2 two.ii one.ii gcc -r -nostdlib -O2 -fno-lto-odr-type-merging -flto one.o two.o