public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114292] New: ICE with a lambda capturing a constant for VLA allocation
@ 2024-03-09 16:26 franckbehaghel_gcc at protonmail dot com
  2024-03-09 22:01 ` [Bug c++/114292] ICE with a generic (templated) " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: franckbehaghel_gcc at protonmail dot com @ 2024-03-09 16:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114292

            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 = 4;

    auto lambda = [&](auto param1) {

        // Define an tmp buffer.
        float buffer[tile_rows * tile_cols]  ;

    };

    int param1=0;
    lambda(param1);

}

int main(int, const char**) {

    int tile_cols = 4;
    process_tile(tile_cols);

    return 0;
}

g++ --version 
g++ (GCC) 14.0.1 20240307 (experimental)

g++ main.cpp
main.cpp: In instantiation of ‘process_tile(int)::<lambda(auto:1)> [with auto:1
= int]’:
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 <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-19 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-09 16:26 [Bug c++/114292] New: ICE with a lambda capturing a constant for VLA allocation franckbehaghel_gcc at protonmail dot com
2024-03-09 22:01 ` [Bug c++/114292] ICE with a generic (templated) " pinskia at gcc dot gnu.org
2024-03-09 22:05 ` [Bug c++/114292] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-03-09 22:07 ` pinskia at gcc dot gnu.org
2024-03-13 16:17 ` jakub at gcc dot gnu.org
2024-03-13 16:26 ` jakub at gcc dot gnu.org
2024-07-19 13:24 ` [Bug c++/114292] [12/13/14/15 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).