From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37410385040C; Fri, 3 Jun 2022 16:49:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37410385040C From: "northon_patrick3 at yahoo dot ca" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/105839] New: internal compiler error: in tsubst_omp_for_iterator, at cp/pt.cc:18122 (instantiate_pending_templates -> instantiate_decl -> tsubst_lambda_expr) Date: Fri, 03 Jun 2022 16:49:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: northon_patrick3 at yahoo dot ca 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 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 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: Fri, 03 Jun 2022 16:49:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105839 Bug ID: 105839 Summary: internal compiler error: in tsubst_omp_for_iterator, at cp/pt.cc:18122 (instantiate_pending_templates -> instantiate_decl -> tsubst_lambda_expr) Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: northon_patrick3 at yahoo dot ca CC: jakub at gcc dot gnu.org Target Milestone: --- Created attachment 53079 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53079&action=3Dedit Result from -freport-bug The code: ``` void test(const auto &b1) { const auto loopImpl =3D [&](auto&& fc) { #pragma omp parallel for for(auto&& [v1, v2] : b1); }; loopImpl([]{}); } void test2() { int a[10]; test(a); } ``` The command line: ``` g++ -fopenmp test.cpp ``` The error: ``` internal compiler error: in tsubst_omp_for_iterator, at cp/pt.cc:18126 11 | for(auto&& [v1, v2] : b1); | ^~~ 0x1ac4724 internal_error(char const*, ...) ???:0 0x663b55 fancy_abort(char const*, int, char const*) ???:0 0x81d054 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0x80614a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ???:0 0x7fedbe instantiate_decl(tree_node*, bool, bool) ???:0 0x81e704 instantiate_pending_templates(int) ???:0 0x7173d1 c_parse_final_cleanups() ???:0 ``` GCC is configured with: ``` configure --prefix=3D/opt/pat-gcc --libdir=3D/opt/pat-gcc/lib --libexecdir=3D/opt/pat-gcc/lib --enable-languages=3Dc,c++,lto --with-isl --with-linker-hash-style=3Dgnu --with-system-zlib --enable-__cxa_atexit --enable-cet=3Dauto --enable-checking=3Drelease --enable-clocale=3Dgnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build= -id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=3Dposix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=3D/opt/pat-gcc/include/dlang/gdc ``` It happens from version 10.1 to latest commit at this date. It no longer crash if: - I don't use structured bindings. - b1 isn't a template. - I remove `auto&& fc`.=