From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 217013858D37; Fri, 17 Nov 2023 21:58:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 217013858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700258331; bh=8fqol/ur96wzxFL7mQjoVv3+OzlQKwfazK2Jy7wOQiE=; h=From:To:Subject:Date:From; b=OEu6LSbptYHiSjOy6qFau2osB/NnSJGECsnHCe4gmp5TQv+8W6t+cpdEHMf2UTApB ky2myJHDv3qDdtmZBPoBIvoOs9iWjPlWHWYjgbDd5KfqWfyAuhdFD/95HQ8N2PO8MT giEBh6ysOSrWcZg7h/+eP2el4MSdx2QlI+wq4zFc= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/112601] New: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag Date: Fri, 17 Nov 2023 21:58:50 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112601 Bug ID: 112601 Summary: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Encountered the bug when tried to build llvm-17.0.5 with -O1 optimization flags.=20 Looks like all the gcc versions I tried fail starting from gcc-10 including current gcc-master r14-5563-gbc274b8d677212. Extracted reproducer: // $ cat a.cpp bool neq(int, int); int begin(); int end(); void deref(int); struct Twine { Twine(const char *); }; int &out(int, Twine); void out6(int, Twine); static void printChar(int &, char) {} int emitStringLiteralDef_OS, emit_OS, emit_I; char emit___trans_tmp_1; struct SequenceToOffsetTable { void emitStringLiteralDef(Twine Decl) { emit(printChar); int __trans_tmp_6 =3D out(emitStringLiteralDef_OS, ""), __trans_tmp_5 =3D out(__trans_tmp_6, ""), __trans_tmp_4 =3D out(__trans_tmp_5, ""), __trans_tmp_3 =3D out(__trans_tmp_4, ""), __trans_tmp_2 =3D out(__trans_tmp_3, Decl); out6(__trans_tmp_2, ""); } void emit(void Print(int &, char)) { for (int E =3D 0; neq(emit_I, E);) for (int SI =3D (deref(emit_I), begin)(), SE =3D (deref(emit_I), end)= (); neq(SI, SE);) Print(emit_OS, emit___trans_tmp_1); } }; void run() { SequenceToOffsetTable RegStrings; RegStrings.emitStringLiteralDef(0); } Crashing: $ gcc/xg++ -B./gcc -O1 -fchecking=3D2 -c a.cpp -o a.o a.cpp: In member function 'void SequenceToOffsetTable::emitStringLiteralDef(Twine)': a.cpp:14:8: error: invalid calls_comdat_local flag 14 | void emitStringLiteralDef(Twine Decl) { | ^~~~~~~~~~~~~~~~~~~~ _ZN21SequenceToOffsetTable20emitStringLiteralDefE5Twine/5 (void SequenceToOffsetTable::emitStringLiteralDef(Twine)) Type: function definition analyzed Visibility: externally_visible semantic_interposition public weak comdat comdat_group:_ZN21SequenceToOffsetTable20emitStringLiteralDefE5Twine one_on= ly Same comdat group as: _ZL9printCharRic/0 References: Referring: Availability: available Function flags: count:1073741824 (estimated locally) body Called by: _Z3runv/7 (1073741824 (estimated locally),1.00 per call) (can throw external) Calls: _Z3neqii/15 (9761289262 (estimated locally),9.09 per call) (can th= row external) _Z3neqii/15 (78977704412 (estimated locally),73.55 per call) (can throw external) _ZL9printCharRic/0 (70290156974 (estimated locally),65.46 p= er call) (can throw external) _Z3endv/14 (8687547438 (estimated locally),8.09 = per call) (can throw external) _Z5derefi/12 (8687547438 (estimated locally),8.09 per call) (can throw external) _Z5beginv/13 (8687547438 (estimated locally),8.09 per call) (can throw external) _Z5derefi/12 (8687547438 (estimated locally),8.09 per call) (can throw external) _Z4out6i5Twine/11 (1073741824 (estimated locally),1.00 per call) (can throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per call) (can throw external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call) (= can throw external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per c= all) (can throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00= per call) (can throw external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call) (can throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per call) (can throw external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call) (can throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per call) (can throw external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call) (= can throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per call) (can throw external) during IPA pass: inline a.cpp:14:8: internal compiler error: verify_cgraph_node failed 0x258970b diagnostic_impl(rich_location*, diagnostic_metadata const*, int, = char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x258a52e internal_error(char const*, ...) ???:0 0xc767c2 cgraph_node::verify_node() ???:0 0xc64d11 symtab_node::verify() ???:0 0x1276003 optimize_inline_calls(tree_node*) ???:0 0xf10813 inline_transform(cgraph_node*) ???:0 0x10a320e execute_all_ipa_transforms(bool) ???:0 0xc7b6e8 cgraph_node::expand() ???:0 0xc7d219 symbol_table::compile() ???:0 0xc7fce4 symbol_table::finalize_compilation_unit() ???:0 $ gcc/xg++ -B./gcc -v Reading specs from ./gcc/specs COLLECT_GCC=3D./gcc/xg++ COLLECT_LTO_WRAPPER=3D./gcc/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib --disable-bootstrap --disable-lto --disable-libsanitizer --disable-libstdcxx-pch --enable-languages=3Dc,c++ --disable-libgomp --disable-libquadmath --disable-libvtv CFLAGS=3D'-O1 -g0' CXXFLAGS=3D'-O1 -= g0' LDFLAGS=3D'-O1 -g0' Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20231117 (experimental) (GCC)=