From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19187 invoked by alias); 7 Nov 2007 15:49:35 -0000 Received: (qmail 19170 invoked by uid 22791); 7 Nov 2007 15:49:35 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Nov 2007 15:49:32 +0000 Received: from zps78.corp.google.com (zps78.corp.google.com [172.25.146.78]) by smtp-out.google.com with ESMTP id lA7FnOW0013668; Wed, 7 Nov 2007 07:49:24 -0800 Received: from smtp.corp.google.com (spacemonkey3.corp.google.com [192.168.120.116]) by zps78.corp.google.com with ESMTP id lA7FnNdi013143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 7 Nov 2007 07:49:23 -0800 Received: from localhost.localdomain.google.com (69-36-227-130.cust.layer42.net [69.36.227.130] (may be forged)) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id lA7FnLVq028560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 7 Nov 2007 07:49:23 -0800 To: "Debarshi Sanyal" Cc: gcc@gcc.gnu.org Subject: Re: How to turn off NRVO in gcc References: <13c56af70711070610o52228b59n3bdbafbdb530d05c@mail.gmail.com> From: Ian Lance Taylor Date: Wed, 07 Nov 2007 16:16:00 -0000 In-Reply-To: <13c56af70711070610o52228b59n3bdbafbdb530d05c@mail.gmail.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00190.txt.bz2 "Debarshi Sanyal" 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 gcc-help@gcc.gnu.org. Please take any followups to that mailing list. Thanks. The answer to your question is no. g++ will always implement NRVO when possible. Ian