https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120409
Stian Halseth <stian at itx dot no> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |stian at itx dot no
--- Comment #16 from Stian Halseth <stian at itx dot no> ---
Same failure on Linux/sparc64, master and 16.2.1. sparc64 returns
structs of up to 32 bytes in registers, so the 24-byte
OptionalPromiseReturn takes the typeck.cc branch from comment 11.
On the question of whether the reduction changed something: it did.
folly's OptionalPromiseReturn has
OptionalPromiseReturn(OptionalPromiseReturn const&) = delete;
// letting dtor be trivial makes the coroutine crash
// TODO: fix clang/llvm codegen
~OptionalPromiseReturn() {}
and both lines were lost in the reduction. Without them the class is
trivially copyable, and [class.temporary]/3 allows the copy on return,
so -mx32 and sparc64 are both conforming.
Adding the deleted copy constructor to the test makes it pass on
sparc64 at all -O levels. A class with all copy/move constructors
deleted is returned in memory under the Itanium ABI. With -mx32 (g++ 13,
compile only) get_return_object() then builds the object directly in
the caller's slot, and the promise gets that address.
The same register-return copy is behind PR119109 (constexpr-nsdmi5.C).