From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 855283858C60; Sat, 9 Mar 2024 16:26:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 855283858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710001562; bh=WYUyVGDR+jOLx7R/ElAo1/eUlhsDBSBJ/hiDhcvmW4g=; h=From:To:Subject:Date:From; b=gfau/CsBEle93ibotyqRYmTVghm2RJk8CK49nwS28Yd6bg9JN+zaAaTAQMZvd3WvB 0YhjDZrmC0inyOV7/Fr/f97nhz7eWssSWStczBv95b/+foDp2G5DoUa//BYBWcNaln TNAhW3CoFVxs6RAgAbNIjD+6OMUGMGZkcE8sUsEg= From: "franckbehaghel_gcc at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114292] New: ICE with a lambda capturing a constant for VLA allocation Date: Sat, 09 Mar 2024 16:26:01 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: franckbehaghel_gcc at protonmail dot 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114292 Bug ID: 114292 Summary: ICE with a lambda capturing a constant for VLA allocation Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: franckbehaghel_gcc at protonmail dot com Target Milestone: --- cat main.cpp void process_tile( int tile_cols) { constexpr int tile_rows =3D 4; auto lambda =3D [&](auto param1) { // Define an tmp buffer. float buffer[tile_rows * tile_cols] ; }; int param1=3D0; lambda(param1); } int main(int, const char**) { int tile_cols =3D 4; process_tile(tile_cols); return 0; } g++ --version=20 g++ (GCC) 14.0.1 20240307 (experimental) g++ main.cpp main.cpp: In instantiation of =E2=80=98process_tile(int):: = [with auto:1 =3D int]=E2=80=99: main.cpp:14:11: required from here 14 | lambda(param1); | ~~~~~~^~~~~~~~ main.cpp:9:22: internal compiler error: in tsubst_expr, at cp/pt.cc:21412 9 | float buffer[tile_rows * tile_cols] ; | ^~~~~~~~~ 0x778cc4 tsubst_expr(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.cc:21412 0x967c7a tsubst_expr(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.cc:20082 0x969973 tsubst_expr(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.cc:20297 0x96eb39 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.cc:16278 0x96ee98 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.cc:16723 0x97e712 tsubst_decl ../../gcc/gcc/cp/pt.cc:15532 0x978e8e tsubst_stmt ../../gcc/gcc/cp/pt.cc:18524 0x977905 tsubst_stmt ../../gcc/gcc/cp/pt.cc:18393 0x977905 tsubst_stmt ../../gcc/gcc/cp/pt.cc:18780 0x977847 tsubst_stmt ../../gcc/gcc/cp/pt.cc:18393 0x977847 tsubst_stmt ../../gcc/gcc/cp/pt.cc:18407 0x977905 tsubst_stmt ../../gcc/gcc/cp/pt.cc:18393 0x977905 tsubst_stmt ../../gcc/gcc/cp/pt.cc:18780 0x9760e6 tsubst_stmt ../../gcc/gcc/cp/pt.cc:27065 0x9760e6 instantiate_body ../../gcc/gcc/cp/pt.cc:27065 0x97688e instantiate_decl(tree_node*, bool, bool) ../../gcc/gcc/cp/pt.cc:27350 0x8732af maybe_instantiate_decl(tree_node*) ../../gcc/gcc/cp/decl2.cc:5616 0x8732af maybe_instantiate_decl(tree_node*) ../../gcc/gcc/cp/decl2.cc:5603 0x8742f5 mark_used(tree_node*, int) ../../gcc/gcc/cp/decl2.cc:5915 0x7e283a build_over_call ../../gcc/gcc/cp/call.cc:10563 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.=