public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115851] New: ICE in gimplify_var_or_parm_decl with coroutine suspension point inside statement expression
@ 2024-07-10  0:37 daklishch at gmail dot com
  2024-08-25 23:34 ` [Bug c++/115851] " daklishch at gmail dot com
  2024-08-26  0:06 ` arsen at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: daklishch at gmail dot com @ 2024-07-10  0:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115851
           Summary: ICE in gimplify_var_or_parm_decl with coroutine
                    suspension point inside statement expression
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daklishch at gmail dot com
  Target Milestone: ---

The following snippet ICEs GCC if the later is invoked with -std=c++20
-fno-exceptions

```
namespace std {
template <typename _Result>
struct coroutine_traits : _Result {};
template <typename = void>
struct coroutine_handle {
    operator coroutine_handle<>();
};
}  // namespace std

struct SuspendNever {
    bool await_ready();
    void await_suspend(std::coroutine_handle<>);
    void await_resume();
};

struct PromiseType {
    void get_return_object();
    SuspendNever initial_suspend();
    SuspendNever final_suspend();
};

struct Coroutine {
    using promise_type = PromiseType;
};

struct ErrorOr {
    int release_error();
};

void warnln(int const&);

Coroutine __async_test_input_basic() {
    ({
        co_await SuspendNever{};
        ErrorOr _temporary_result2;
        warnln(_temporary_result2.release_error());
    });
}
```

(if you prefer standard-complying code, replace std namespace with #include
<coroutine>)

CE link: https://godbolt.org/z/ePrP7rh73

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

* [Bug c++/115851] ICE in gimplify_var_or_parm_decl with coroutine suspension point inside statement expression
  2024-07-10  0:37 [Bug c++/115851] New: ICE in gimplify_var_or_parm_decl with coroutine suspension point inside statement expression daklishch at gmail dot com
@ 2024-08-25 23:34 ` daklishch at gmail dot com
  2024-08-26  0:06 ` arsen at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: daklishch at gmail dot com @ 2024-08-25 23:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dan Klishch <daklishch at gmail dot com> ---
GCC seems to do checks for coroutine-related types more eagerly now, so the
original minified reproducer is rejected. Nonetheless, the underlying issue
persists, which can be shown using this snippet:

```
#include <coroutine>

struct SuspendNever {
    bool await_ready();
    void await_suspend(std::coroutine_handle<>);
    void await_resume();
};

struct Coroutine;

struct PromiseType {
    Coroutine get_return_object();
    SuspendNever initial_suspend();
    SuspendNever final_suspend();
};

struct Coroutine {
    using promise_type = PromiseType;
};

struct ErrorOr {
    int release_error();
};

void warnln(int const&);

Coroutine __async_test_input_basic() {
    ({
        co_await SuspendNever{};
        ErrorOr _temporary_result2;
        warnln(_temporary_result2.release_error());
    });
}
```

CE link: https://godbolt.org/z/aG588Whv6

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

* [Bug c++/115851] ICE in gimplify_var_or_parm_decl with coroutine suspension point inside statement expression
  2024-07-10  0:37 [Bug c++/115851] New: ICE in gimplify_var_or_parm_decl with coroutine suspension point inside statement expression daklishch at gmail dot com
  2024-08-25 23:34 ` [Bug c++/115851] " daklishch at gmail dot com
@ 2024-08-26  0:06 ` arsen at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: arsen at gcc dot gnu.org @ 2024-08-26  0:06 UTC (permalink / raw)
  To: gcc-bugs

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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org

--- Comment #2 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
thanks for the updated testcase - indeed, we haven't fixed the underlying cause
yet (we do plan on doing it soon).

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

end of thread, other threads:[~2024-08-26  0:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-10  0:37 [Bug c++/115851] New: ICE in gimplify_var_or_parm_decl with coroutine suspension point inside statement expression daklishch at gmail dot com
2024-08-25 23:34 ` [Bug c++/115851] " daklishch at gmail dot com
2024-08-26  0:06 ` arsen 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).