From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CBF77385DC1D; Wed, 27 Mar 2024 20:55:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBF77385DC1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711572932; bh=PMe/DQXX3Qvt9sewJ9BBoFETimdGkzz+nig6T3Quq2I=; h=From:To:Subject:Date:From; b=XhzaMjtDSKfTzIoGbsSmP/1OI6RygBItmWcri2/mfgziz//Z1bFDJlC2jn518WYza BuAYO8MFPl7iJeBAi7fEc2O7vvTbNNIhfZjjs0uyEjGm8FMhgFL9v7c/w7TDlmp5up 0o4LosJpmr4b6C/sa78ZLgHNlVGe+70ZkKtrhdfE= From: "nerixdev at outlook dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/114501] New: ICE during modref with LTO Date: Wed, 27 Mar 2024 20:55:31 +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: nerixdev at outlook dot de 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 target_milestone attachments.created 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=3D114501 Bug ID: 114501 Summary: ICE during modref with LTO Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: nerixdev at outlook dot de Target Milestone: --- Created attachment 57822 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57822&action=3Dedit Preprocessed source The following C++ 20 code causes an ICE when compiled with -flto: #include #include inline constexpr auto make_it() { constexpr std::string_view view{"", 0}; std::array arr; arr[view.size()] =3D 'a'; // using 0 here won't cause an ICE return arr; } inline constexpr auto foo =3D make_it(); auto bar =3D foo; --- The same bug happens from GCC 10 to the current version listed as (trunc) on compiler-explorer: https://godbolt.org/z/xve6h5qhh. I'm using GCC 13.2.0 be= low. I've included the .ii file as the attachment. The code was compiled with g++ -std=3Dc++20 foo.cpp -o foo.o -c -flto. Output of gcc -v -save-temps : Using built-in specs. COLLECT_GCC=3Dgcc Target: x86_64-linux-gnu Configured with: /usr/src/gcc/configure --build=3Dx86_64-linux-gnu --disable-multilib --enable-languages=3Dc,c++,fortran,go Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.0 (GCC)=20 COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-std=3Dc++20' '-c' '-flto' '-frep= ort-bug' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/local/libexec/gcc/x86_64-linux-gnu/13.2.0/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE foo.cpp -mtune=3Dgeneric -march= =3Dx86-64 -std=3Dc++20 -flto -freport-bug -fpch-preprocess -o foo.ii ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/include-fixed/x86_64-linux-gnu" ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/../../../../x86_64-linux-gnu/in= clude" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/../../../../include/c++/13.2.0 /usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/../../../../include/c++/13.2.0/x= 86_64-linux-gnu /usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/../../../../include/c++/13.2.0/b= ackward /usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/include /usr/local/include /usr/local/lib/gcc/x86_64-linux-gnu/13.2.0/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-std=3Dc++20' '-c' '-flto' '-frep= ort-bug' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/local/libexec/gcc/x86_64-linux-gnu/13.2.0/cc1plus -fpreprocessed foo.= ii -quiet -dumpbase foo.cpp -dumpbase-ext .cpp -mtune=3Dgeneric -march=3Dx86-64 -std=3Dc++20 -version -flto -freport-bug -o foo.s GNU C++20 (GCC) version 13.2.0 (x86_64-linux-gnu) compiled by GNU C version 13.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 4919020133b793ebcf160ec1288a96cd during IPA pass: modref foo.cpp:13:15: internal compiler error: in streamer_write_chain, at tree-streamer-out.cc:543 13 | auto bar =3D foo; | ^ 0x1c989f6 internal_error(char const*, ...) ???:0 0x75eba6 fancy_abort(char const*, int, char const*) ???:0 0x106eece streamer_write_tree_body(output_block*, tree_node*) ???:0 0xd18d4d DFS::DFS(output_block*, tree_node*, bool, bool, bool) ???:0 0xd1a1f9 lto_output_tree(output_block*, tree_node*, bool, bool) ???:0 0xd1cc43 produce_asm_for_decls() ???:0 0xd9c852 ipa_write_summaries() ???:0 0xa67be7 symbol_table::finalize_compilation_unit() ???:0 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem.=