On Wed, Nov 07, 2007 at 07:48:53AM -0800, Ian Lance Taylor wrote: > "Debarshi Sanyal" <[EMAIL PROTECTED]> writes: > > > Is there any way to turn off "named return value optimization" > > (NRVO) while compiling a C++ program with g++? > > This question is not appropriate for gcc@gcc.gnu.org, which is for > developers of gcc. It is appropriate for [EMAIL PROTECTED] > Please take any followups to that mailing list. Thanks. > > The answer to your question is no. g++ will always implement NRVO > when possible.
You forgot about -fno-elide-constructors , Ian. I've needed it in the past to work around a bug in profiling; there's a PR for this.