https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114353
Bug ID: 114353 Summary: ICE when passing LTO object files compiled for x86_64-pc-linux-gnu to x86_64-w64-mingw32-gcc Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: peter0x44 at disroot dot org Target Milestone: --- Not a particularly important problem, but I managed to trigger this on accident. $ touch test.c $ x86_64-pc-linux-gnu-gcc -flto test.c -c $ x86_64-w64-mingw32-gcc -flto test.o lto1: internal compiler error: in lto_read_in_decl_state, at lto/lto-common.cc:195 0x19d38c7 internal_error(char const*, ...) ???:0 0x6832d2 fancy_abort(char const*, int, char const*) ???:0 0x6cd5ff read_cgraph_and_symbols(unsigned int, char const**) ???:0 0x6b9872 lto_main() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://bugs.archlinux.org/> for instructions. lto-wrapper: fatal error: x86_64-w64-mingw32-gcc returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status There is also an ICE I do it backwards: $ x86_64-w64-mingw32-gcc -flto test.c -c $ x86_64-w64-pc-linux-gnu -flto test.o But, it is at a different source location: lto1: internal compiler error: in lto_input_ts_decl_with_vis_tree_pointers, at tree-streamer-in.cc:774 0x1851644 internal_error(char const*, ...) ???:0 0x67856f fancy_abort(char const*, int, char const*) ???:0 0xa1ebf8 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) ???:0 0xa1f0eb lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*, bool) ???:0 0x6d674e read_cgraph_and_symbols(unsigned int, char const**) ???:0 0x6d7f5f lto_main() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://bugs.archlinux.org/> for instructions. lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status $ x86_64-pc-linux-gnu-gcc --version x86_64-pc-linux-gnu-gcc (GCC) 13.2.1 20230801 $ x86_64-w64-mingw32-gcc --version x86_64-w64-mingw32-gcc (GCC) 13.1.0