From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 33CBC3857352; Mon, 13 Jun 2022 18:25:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33CBC3857352 From: "msc at linux dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105956] New: internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1819 Date: Mon, 13 Jun 2022 18:25:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msc at linux dot ibm.com 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 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: Mon, 13 Jun 2022 18:25:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105956 Bug ID: 105956 Summary: internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1819 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: msc at linux dot ibm.com Target Milestone: --- Bumped into this error while compiling boost.fiber with upstream GCC: $ git gcc-descr HEAD r12-9379-g1158fe43407568 $ "/tmp/gcc-install/bin/gcc" -freport-bug -fvisibility-inlines-hidden -fPIC -m64 -pthread -O0 -fno-inline -Wall -g -fvisibility=3Dhidden=20 -DBOOST_ALL_NO_LIB=3D1 -DBOOST_CONTEXT_DYN_LINK=3D1 -DBOOST_FIBERS_DYN_LINK= =3D1 -DBOOST_FIBERS_SOURCE -DBOOST_FILESYSTEM_DYN_LINK=3D1 -I"../../.." -c -o "../../../bin.v2/libs/fiber/build/gcc-custom/debug/threading-multi/visibili= ty-hidden/scheduler.o" "../../../libs/fiber/src/scheduler.cpp" In file included from ../../../boost/intrusive/options.hpp:19, from ../../../boost/intrusive/list_hook.hpp:22, from ../../../boost/intrusive/list.hpp:20, from ../../../boost/fiber/scheduler.hpp:17, from ../../../libs/fiber/src/scheduler.cpp:7: ../../../boost/intrusive/pack_options.hpp: In instantiation of =E2=80=98str= uct boost::intrusive::invert_typelist_impl, &boost::fibers::waker_with_hook::waker_queue_hook_>, boost::intrusive::constant_time_size, boost::intrusive::cache_last >, boost::intrusive::index_tuple<0, 1, 2, 3> >=E2=80=99: ../../../boost/intrusive/pack_options.hpp:190:71: required from =E2=80=98= struct boost::intrusive::invert_typelist, &boost::fibers::waker_with_hook::waker_queue_hook_>, boost::intrusive::constant_time_size, boost::intrusive::cache_last > >=E2=80=99 ../../../boost/intrusive/pack_options.hpp:230:55: required from =E2=80=98= struct boost::intrusive::pack_options, &boost::fibers::waker_with_hook::waker_queue_hook_>, boost::intrusive::constant_time_size, boost::intrusive::cache_last >=E2=80=99 ../../../boost/intrusive/slist.hpp:2149:15: required from =E2=80=98struct boost::intrusive::make_slist, &boost::fibers::waker_with_hook::waker_queue_hook_>, boost::intrusive::constant_time_size, boost::intrusive::cache_last >=E2=80=99 ../../../boost/intrusive/slist.hpp:2173:7: required from =E2=80=98class boost::intrusive::slist, &boost::fibers::waker_with_hook::waker_queue_hook_>, boost::intrusive::constant_time_size, boost::intrusive::cache_last >=E2=80=99 ../../../boost/fiber/waker.hpp:73:36: required from here ../../../boost/intrusive/pack_options.hpp:164:29: internal compiler error: = in iterative_hash_template_arg, at cp/pt.cc:1819 164 | static const std::size_t last_idx =3D sizeof_typelist:= :value - 1; | ^~~~~~~~ 0x6ec942 iterative_hash_template_arg(tree_node*, unsigned int) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:1819 0xb105c5 iterative_hash_template_arg(tree_node*, unsigned int) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:1829 0xb10fc8 hash_tmpl_and_args /home/mscastanho/dev/gcc/gcc/cp/pt.cc:1769 0xb10fc8 spec_hasher::hash(tree_node*, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:1776 0xb3389b tsubst_decl /home/mscastanho/dev/gcc/gcc/cp/pt.cc:14991 0xb26d87 tsubst_copy /home/mscastanho/dev/gcc/gcc/cp/pt.cc:17066 0xb2a720 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:21390 0xb2a2f6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:20434 0xb2bb15 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:20283 0xb35d08 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:19595 0xb4b4dc tsubst_template_args(tree_node*, tree_node*, int, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13580 0xb54d8f tsubst_aggr_type /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13796 0xb54d8f tsubst_aggr_type /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13753 0xb49154 tsubst(tree_node*, tree_node*, int, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:16282 0xb35497 gen_elem_of_pack_expansion_instantiation /home/mscastanho/dev/gcc/gcc/cp/pt.cc:12749 0xb35497 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13417 0xb4b6e2 tsubst_template_args(tree_node*, tree_node*, int, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13566 0xb4b905 tsubst_argument_pack(tree_node*, tree_node*, int, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13517 0xb4b6b4 tsubst_template_args(tree_node*, tree_node*, int, tree_node*) /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13578 0xb54d8f tsubst_aggr_type /home/mscastanho/dev/gcc/gcc/cp/pt.cc:13796 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See for instructions. Preprocessed source stored into /tmp/ccVLIwjb.out file, please attach this = to your bugreport. I'm not that familiar with the code to be able to create a smaller reproduc= er, but I'm attaching the pre-processed source generated by -freport-bug. I was able to reproduce this both on ppc64le and x86_64. GCC configured wit= h: /configure --prefix=3D/tmp/gcc-install --enable-languages=3Dc,c++ --disable-bootstrap --disable-multilib After doing a quick bisect I suspect the issue was introduced by the follow= ing commit: commit cb7fd1ea85feea7ef65328330fc2577a95e99400 Author: Patrick Palka Date: Fri Jun 10 16:09:48 2022 -0400 c++: optimize specialization of nested templated classes=