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

            Bug ID: 117175
           Summary: Internal compiler error in gimple_add_tmp_var, at
                    gimplify.cc:802
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kernalex256 at yandex dot ru
  Target Milestone: ---

The following code produces an ICE under GCC 14.2.0 on x86_64 Linux:

#include <coroutine>
#include <string>
#include <vector>

struct promise;
struct coroutine : std::coroutine_handle<promise> {
    using promise_type = ::promise;
};

struct promise {
    coroutine get_return_object() { return {coroutine::from_promise(*this)}; }
    std::suspend_always initial_suspend() noexcept { return {}; }
    std::suspend_always final_suspend() noexcept { return {}; }
    void return_void() {}
    void unhandled_exception() {}
};

struct awaitable {
    bool await_ready() { return false; }
    void await_suspend(std::coroutine_handle<> h) {}
    void await_resume() {}
};

struct s1 {
    std::string data;
};

awaitable g(std::vector<s1> b);

coroutine f() {
    co_await g(
        {
            {.data = "4"},
            {.data = "3"},
        }
    );
}

The code is compiled with --std=c++23 flag, no other flags are needed.

The error message is:

<source>: In function 'void f(f()::_Z1fv.Frame*)':
<source>:34:22: internal compiler error: in gimple_add_tmp_var, at
gimplify.cc:802
   34 |             {.data = "4"},
      |                      ^~~
0x2031cbc internal_error(char const*, ...)
        ???:0
0x77895f fancy_abort(char const*, int, char const*)
        ???:0
0xc4f7db gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4f825 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc55a18 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
        ???:0
0xc4f0eb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4dadd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4f914 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4dadd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4e333 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4dadd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4f8fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4f8fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4dadd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4e333 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4dadd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4f8fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4dadd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc4f8fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xc51ede gimplify_body(tree_node*, bool)
        ???:0
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.
Compiler returned: 1
  • [Bug c++/117175] New: Internal c... kernalex256 at yandex dot ru via Gcc-bugs

Reply via email to