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

            Bug ID: 108489
           Summary: internal_error adding data fields in a promise_type
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janwilmans at gmail dot com
  Target Milestone: ---

https://cppcoach.godbolt.org/z/xr58MxGf9


```
#include <coroutine>

struct ReturnObject {

    struct promise_type {
        ReturnObject get_return_object() { 
            return {};
        }

        std::suspend_always initial_suspend() {
            return {}; 
        } 

        std::suspend_never final_suspend() noexcept { return {}; }
        void unhandled_exception() {}
    };

    int value = 0;
    std::coroutine_handle<> m_handle;
};

ReturnObject example() {
    co_await std::suspend_always{};
}

int main() 
{
    example();  
    return 0;
}
```


during RTL pass: expand
<source>: In function 'ReturnObject example()':
<source>:22:14: internal compiler error: in get_address_mode, at
rtlanal.cc:6277
   22 | ReturnObject example() {
      |              ^~~~~~~
0x1bb069e internal_error(char const*, ...)
        ???:0
0x6ff396 fancy_abort(char const*, int, char const*)
        ???:0
0xa7ecfc adjust_address_1(rtx_def*, machine_mode, poly_int<1u, long>, int, int,
int, poly_int<1u, long>)
        ???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/ccF40xai.out file, please attach this to
your bugreport.
ASM generation compiler returned: 1
during RTL pass: expand
<source>: In function 'ReturnObject example()':
<source>:22:14: internal compiler error: in get_address_mode, at
rtlanal.cc:6277
   22 | ReturnObject example() {
      |              ^~~~~~~
0x1bb069e internal_error(char const*, ...)
        ???:0
0x6ff396 fancy_abort(char const*, int, char const*)
        ???:0
0xa7ecfc adjust_address_1(rtx_def*, machine_mode, poly_int<1u, long>, int, int,
int, poly_int<1u, long>)
        ???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/ccG4ns4f.out file, please attach this to
your bugreport.
Execution build compiler returned: 1

Reply via email to