Re: Function returning struct on x86_64 (at least)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 6 Jan 2020, Chris Hall wrote:

[description of NRVO]

Is there any way in which I can persuade the compiler that a function returning a struct does not need to worry about preserving the value of the final destination (ie the struct at %rdi) ?

Compile the file as C++ instead of C. Not that it would be forbidden in C, but the optimization happens to be in the C++ front-end. There is also an optimization pass called nrv, but it does trigger that often.

--
Marc Glisse



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux