From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 47F5D3856DD4; Wed, 18 May 2022 12:09:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47F5D3856DD4 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/105600] [12/13 Regression] ICE with LTO when building Mumble since r12-5696-g53caa4723d8de73f Date: Wed, 18 May 2022 12:09:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 12:09:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105600 --- Comment #9 from Martin Li=C5=A1ka --- So what happens in WPA: 1) we read IPA ICF summary and the variable has definition: (gdb) p vnode->debug() _ZN8nlohmann6detail12static_constINS0_10to_json_fnEE5valueE/10 (value) @0x7ffff7fb3200 Type: variable definition analyzed Visibility: externally_visible semantic_interposition preempted_reg public weak comdat comdat_group:_ZN8nlohmann6detail12static_constINS0_10to_json_fnEE5valueE one_only References:=20 Referring: _Z7to_jsonRN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringI= cSt11char_traitsIcESaIcEEEblmiSaNS_14adl_serializerES2_IhSaIhEEEERK8Setting= s/1 (addr) _Z7to_jsonRN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringI= cSt11char_traitsIcESaIcEEEblmiSaNS_14adl_serializerES2_IhSaIhEEEERK8Setting= s/1 (addr)=20 Read from file: a.o Availability: not-ready Varpool flags: initialized read-only const-value-known $1 =3D void 2) the symbols is removed in unreachable nodes: #0 symbol_table::remove_unreachable_nodes (this=3D, file=3D) at /home/marxin/Programming/gcc/gcc/ipa.cc:639 #1 0x00000000008e1277 in read_cgraph_and_symbols (nfiles=3D, fnames=3D) at /home/marxin/Programming/gcc/gcc/lto/lto-common.cc:2959 #2 0x00000000008c7540 in lto_main () at /home/marxin/Programming/gcc/gcc/lto/lto.cc:626 #3 0x0000000000e229d4 in compile_file () at /home/marxin/Programming/gcc/gcc/toplev.cc:452 #4 0x00000000008a0822 in do_compile (no_backend=3Dfalse) at /home/marxin/Programming/gcc/gcc/toplev.cc:2144 #5 toplev::main (this=3Dthis@entry=3D0x7fffffffd93e, argc=3D, argc@entry=3D17, argv=3D, argv@entry=3D0x7fffffffda68) at /home/marxin/Programming/gcc/gcc/toplev.cc:2296 #6 0x00000000008a1f32 in main (argc=3D17, argv=3D0x7fffffffda68) at /home/marxin/Programming/gcc/gcc/main.cc:39 3) IPA ICF loads the body: (gdb) p item->node->debug() _ZN8nlohmann6detail12static_constINS0_10to_json_fnEE5valueE/10 (value) @0x7ffff7fb3200 Type: variable Body removed by symtab_remove_unreachable_nodes Visibility: externally_visible semantic_interposition preempted_reg exter= nal public weak comdat comdat_group:_ZN8nlohmann6detail12static_constINS0_10to_json_fnEE5valueE one_only References:=20 Referring: _Z7to_jsonRN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringI= cSt11char_traitsIcESaIcEEEblmiSaNS_14adl_serializerES2_IhSaIhEEEERK8Setting= s/1 (addr) _Z7to_jsonRN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringI= cSt11char_traitsIcESaIcEEEblmiSaNS_14adl_serializerES2_IhSaIhEEEERK8Setting= s/1 (addr)=20 Read from file: a.o Availability: not_available Varpool flags: initialized read-only $8 =3D void So we need to filter our such symbols.=