https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84805
Bug ID: 84805 Summary: [8 Regression] ICE in get_odr_type, at ipa-devirt.c:2096 since r258133 Product: gcc Version: unknown Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Following ICEs: $ g++ -shared -fPIC -flto=8 -O2 -std=gnu++17 libre-1.ii libre-2.ii libre-3.ii libre-1.ii:139:7: warning: type ‘struct XclRoot’ violates the C++ One Definition Rule [-Wodr] class XclRoot { ^ libre-2.ii:1:7: note: a different type is defined in another translation unit class XclRoot { ^ libre-1.ii:142:16: note: the first difference of corresponding definitions is field ‘mrData’ XclRootData &mrData; ^ libre-2.ii:1:7: note: a type with different number of fields is defined in another translation unit class XclRoot { ^ libre-1.ii:144:7: warning: type ‘struct XclImpRoot’ violates the C++ One Definition Rule [-Wodr] class XclImpRoot : XclRoot {}; ^ libre-2.ii:5:7: note: a type with different bases is defined in another translation unit class XclImpRoot : XclRoot {}; ^ libre-2.ii:6:8: warning: type ‘struct RootData’ violates the C++ One Definition Rule [-Wodr] struct RootData { ^ libre-3.ii:121:8: note: a different type is defined in another translation unit struct RootData { ^ libre-2.ii:7:14: note: the first difference of corresponding definitions is field ‘pIR’ XclImpRoot pIR; ^ libre-3.ii:122:11: note: a field with different name is defined in another translation unit BiffTyp eDateiTyp; ^ libre-3.ii:18:7: warning: type ‘struct __shared_ptr’ violates the C++ One Definition Rule [-Wodr] class __shared_ptr : __shared_ptr_access< a, l > { ^ libre-1.ii:21:7: note: a different type is defined in another translation unit class __shared_ptr : __shared_ptr_access< _Tp, _Lp > { ^ libre-3.ii:20:6: note: the first difference of corresponding definitions is field ‘_M_ptr’ m *_M_ptr; ^ libre-1.ii:23:17: note: a field of same name but different type is defined in another translation unit element_type *_M_ptr; ^ libre-3.ii:19:14: note: type ‘struct m’ should match type ‘struct element_type’ using m = a; ^ libre-1.ii:22:27: note: the incompatible type is defined here using element_type = _Tp; ^ libre-1.ii:103:8: warning: type ‘struct XclRootData’ violates the C++ One Definition Rule [-Wodr] struct XclRootData { ^ libre-3.ii:82:8: note: a different type is defined in another translation unit struct XclRootData { ^ libre-1.ii:136:15: note: the first difference of corresponding definitions is field ‘mxRD’ RootDataRef mxRD; ^ libre-3.ii:107:22: note: a field of same name but different type is defined in another translation unit std::n< RootData > mxRD; ^ libre-1.ii:111:39: note: type ‘struct RootDataRef’ should match type ‘struct n’ typedef std::shared_ptr< RootData > RootDataRef; ^ libre-3.ii:23:31: note: the incompatible type is defined here template < typename a > class n : __shared_ptr< a > {}; ^ lto1: internal compiler error: in get_odr_type, at ipa-devirt.c:2096 0x8d7ca7 get_odr_type(tree_node*, bool) ../../gcc/ipa-devirt.c:2096 0x8d7e0c register_odr_type(tree_node*) ../../gcc/ipa-devirt.c:2121 0x6156a0 lto_read_decls ../../gcc/lto/lto.c:1782 0x6178c4 lto_file_finalize ../../gcc/lto/lto.c:2076 0x6178c4 lto_create_files_from_ids ../../gcc/lto/lto.c:2086 0x6178c4 lto_file_read ../../gcc/lto/lto.c:2127 0x6178c4 read_cgraph_and_symbols ../../gcc/lto/lto.c:2839 0x6178c4 lto_main() ../../gcc/lto/lto.c:3356 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. make: *** [/tmp/cc6NqUBv.mk:2: /tmp/ccU4uBCo.ltrans0.ltrans.o] Error 1 lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status