https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83169
--- Comment #6 from Iain Buclaw <ibuclaw at gdcproject dot org> --- (In reply to Andrew Pinski from comment #5) > (In reply to Iain Buclaw from comment #4) > > The generated code sets the address of the constructed variable the same the > > as the return address, yet the condition is assumed false by the optimizer. > > data is not taken as an address except in the equals so it cannot be the > same as the global variable pointer. And using ptest after data goes out of > scope in footest is undefined code. > > So the difference is just based on undefined code. So setting CALL_EXPR_RETURN_SLOT_OPT is no guarantee that the return slot is the address of 'data'? At least from the optimizers POV?