https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77905
Bug ID: 77905 Summary: ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in ipa_comdats, at ipa-comdats.c:352) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Target Milestone: --- $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20161008 (experimental) [trunk revision 240893] (GCC) $ $ gcc-trunk -c -O2 small.C small.C:17:19: internal compiler error: in ipa_comdats, at ipa-comdats.c:352 C::C(int) : A(1) {} ^ 0x15145eb ipa_comdats ../../gcc-source-trunk/gcc/ipa-comdats.c:352 0x15145eb execute ../../gcc-source-trunk/gcc/ipa-comdats.c:412 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ $ cat small.C struct A { A(int); }; struct B : A { B(); } A; struct C : virtual A { C(int); }; A::A(int p1) { if (p1) A(0); } B::B() : A(1) {} C::C(int) : A(1) {} $