C++ copy elision and escaping address of return slot

Marc Glisse marc.glisse@inria.fr
Wed Jun 2 12:31:53 GMT 2021


On Wed, 2 Jun 2021, Liu Hao via Gcc-help wrote:

> However I expect there to be a better way to mitigate this: Is it possible to 
> inform GCC to assume that the return slot cannot alias anything?

I assume we will eventually fix
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80740
it shouldn't be too hard assuming we agree that it is legal.

I am not aware of a way for a user to add restrict on the hidden return 
pointer.

-- 
Marc Glisse


More information about the Gcc-help mailing list