https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98401
David Sicilia <dpsicilia at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dpsicilia at gmail dot com
--- Comment #2 from David Sicilia <dpsicilia at gmail dot com> ---
I believe I've just run into this as well. In some cases (which I don't know
how to describe) when I co_await on a temporary I get an error that manifests
as a sanitizer error (in my build):
"runtime error: member call on misaligned address 0x00000095c55e for type
'struct optional', which requires 8 byte alignment."
When I store the awaitable first in a local variable, then co_await on that,
the issue goes away.
Unfortunately I have not managed to produce a minimal reproducer yet, so not
sure how much this helps, but it would seem that gcc's handling of co_wait'ing
on temporaries needs to be looked at.
Also want to point out that with Milo Brandt's reproducer, it has different
output between gcc 10.2 and gcc trunk:
gcc 10.2: https://godbolt.org/z/rPdY9f
gcc trunk: https://godbolt.org/z/Y1adoq
The gcc 10.2 output looks correct to me, so it could be a regression? That
said, I observed my issue on gcc 10.2 (not trunk), so it may not be a
regression.