From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B91A53858D37; Thu, 14 Jul 2022 17:18:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B91A53858D37 From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/106305] New: ICE on valid code at -O1 with -funreachable-traps: verify_cgraph_node failed Date: Thu, 14 Jul 2022 17:18:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhendong.su at inf dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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: Thu, 14 Jul 2022 17:18:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106305 Bug ID: 106305 Summary: ICE on valid code at -O1 with -funreachable-traps: verify_cgraph_node failed Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch CC: marxin at gcc dot gnu.org Target Milestone: --- Compiler Explorer: https://godbolt.org/z/WdMsGaG3b [525] % gcctk -v Using built-in specs. COLLECT_GCC=3Dgcctk COLLECT_LTO_WRAPPER=3D/local/suz-local/software/local/gcc-trunk/libexec/gcc= /x86_64-pc-linux-gnu/13.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=3D/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=3Dc,c++ --disable-werror --enable-multilib --with-system= -zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.0 20220714 (experimental) [master r13-1696-g29f40a8047f] (= GCC)=20 [526] %=20 [526] % gcctk -O1 -funreachable-traps small.c small.c:10:1: error: edge points to wrong declaration: 10 | } | ^ > QI size unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7f6e710c75e8 arg-types >> volatile nothrow public external built-in decl_6 QI :0:0 align:8 warn_if_not_align:0 built-in: BUILT_IN_NORMAL:BUILT_IN_TRAP con= text attributes chain chain chain >>>> chain > Instead of: unit-size align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-ty= pe 0x7f6e710b75e8 precision:32 min max pointer_to_this > QI size unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7f6e710e0498 attributes value > chain value chain chain >>>>> arg-types > pointer_to_this > addressable used public external built-in decl_3 decl_5 QI small.c:1:5 align:8 warn_if_not_align:0 built-in: BUILT_IN_NORMAL:BUILT_IN_PRINTF context chain > b/4 (b) @0x7f6e71200330 Type: function definition analyzed Visibility: semantic_interposition public next sharing asm name: 1 References: a/0 (read)=20 Referring:=20 Function b/4 is inline copy in main/2 Clone of b/1 Availability: local Function flags: count:1073741824 (estimated locally) body local executed_= once Called by: main/2 (inlined) (1073741824 (estimated locally),1.00 per call= )=20 Calls: __builtin_trap/5 (0 (precise),0.00 per call)=20 during IPA pass: inline small.c:10:1: internal compiler error: verify_cgraph_node failed 0xa224a8 cgraph_node::verify_node() ../../gcc-trunk/gcc/cgraph.cc:3881 0xa112c4 symtab_node::verify() ../../gcc-trunk/gcc/symtab.cc:1359 0xa12507 symtab_node::verify_symtab_nodes() ../../gcc-trunk/gcc/symtab.cc:1387 0xcce301 symtab_node::checking_verify_symtab_nodes() ../../gcc-trunk/gcc/cgraph.h:682 0xcce301 symbol_table::remove_unreachable_nodes(_IO_FILE*) ../../gcc-trunk/gcc/ipa.cc:678 0xde8781 execute_todo ../../gcc-trunk/gcc/passes.cc:2159 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. [527] %=20 [527] % cat small.c int printf(const char *, ...); char *a =3D "hello"; void b(int c) { if (c) printf(a); } int main() { b(0); return 0; }=