https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120409
--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to H.J. Lu from comment #12) > (In reply to Iain Sandoe from comment #5) > > well .. the visible difference in gimple, but this is code outside of the > > coroutines changes (i.e. just a bit of regular C++). > > > > However, it does seem we create the return object correctly .. and then > > return an empty one. We seem to be failing to do copy elision. > > > > On x32, OptionalPromiseReturn is 16 bytes, which is returned in 2 registers. > You can't assume that copy elision will happen. You need to prepare for it. Hmm .. but I think copy elision is mandated by c++17 - so we need to figure out a solution< i guess.