https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107944
Bug ID: 107944 Summary: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jamborm at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone: --- Created attachment 53994 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53994&action=edit Reproducer I noticed that while building libbackend.a with -flto and partial linking and I tried to reduce it to something smaller. However, the result is still pretty big. $ g++ -w -O2 -flto -c *.ii -fno-exceptions -Wfatal-errors && g++ -Wfatal-errors -flinker-output=nolto-rel -r -o libbackend.a -flto=1 [123456].o -w /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 3.o (symbol from plugin): in function `global_trees_6': (.text+0x0): multiple definition of `integer_types_0'; 1.o (symbol from plugin):(.text+0x0): first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 3.o (symbol from plugin): in function `global_trees_6': (.text+0x0): multiple definition of `__trans_tmp_2'; 2.o (symbol from plugin):(.text+0x0): first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 3.o (symbol from plugin): in function `global_trees_6': (.text+0x0): multiple definition of `__trans_tmp_3'; 2.o (symbol from plugin):(.text+0x0): first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 6.o (symbol from plugin): in function `__trans_tmp_1': (.text+0x0): multiple definition of `__trans_tmp_1'; 2.o (symbol from plugin):(.text+0x0): first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 6.o (symbol from plugin): in function `__trans_tmp_1': (.text+0x0): multiple definition of `space_nelems'; 4.o (symbol from plugin):(.text+0x0): first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 6.o (symbol from plugin): in function `__trans_tmp_1': (.text+0x0): multiple definition of `reserve_reserve'; 4.o (symbol from plugin):(.text+0x0): first defined here 1.ii:67:8: note: type ‘struct tree_base’ itself violates the C++ One Definition Rule 67 | struct tree_base { | ^ 2.ii:452:8: note: the incompatible type is defined here 452 | struct tree_base { | ^ 2.ii:456:12: note: type ‘struct <anon>’ itself violates the C++ One Definition Rule 456 | struct { | ^ 3.ii:340:18: note: the incompatible type is defined here 340 | struct { | ^ 2.ii:143:7: note: type name ‘hash_table<hash_map<tree_node*, tree_node*, simple_hashmap_traits<default_hash_traits<tree_node*>, tree_node*> >::hash_entry, false, xcallocator>’ should match type name ‘hash_table<int, false, xcallocator>’ 143 | class hash_table { | ^ 3.ii:237:131: note: the incompatible type is defined here 237 | template <typename Descriptor, bool Lazy = false, template <typename Type> class Allocator = xcallocator> class hash_table { | ^ 2.ii:143:7: note: type ‘struct hash_table’ itself violates the C++ One Definition Rule 143 | class hash_table { | ^ 3.ii:237:131: note: the incompatible type is defined here 237 | template <typename Descriptor, bool Lazy = false, template <typename Type> class Allocator = xcallocator> class hash_table { | ^ lto-wrapper: warning: using serial compilation of 3 LTRANS jobs lto-wrapper: note: see the ‘-flto’ option documentation for more information during IPA pass: inline In function ‘reserve’, inlined from ‘reserve’ at 4.ii:210:19, inlined from ‘reserve’ at 4.ii:199:35, inlined from ‘safe_push’ at 4.ii:220:10, inlined from ‘optimize_stmt’ at 4.ii:2254:36: 4.ii:142:52: internal compiler error: Segmentation fault 142 | unsigned alloc = vec_prefix::calculate_allocation(v ? &v->m_vecpfx : 0, | ^ 0x102f987 internal_error(char const*, ...) ???:0 0x117935b cgraph_node::get_untransformed_body() ???:0 0x123f6e9 optimize_inline_calls(tree_node*) ???:0 0x123e4d2 inline_transform(cgraph_node*) ???:0 0x123da5f execute_all_ipa_transforms(bool) ???:0 0x15ebe1b cgraph_node::expand() ???:0 0x15e2f6d symbol_table::compile() ???:0 0x15d0368 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.opensuse.org/> for instructions. lto-wrapper: fatal error: g++ returned 1 exit status compilation terminated. /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status