From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30023 invoked by alias); 29 Mar 2008 22:57:48 -0000 Received: (qmail 30013 invoked by uid 22791); 29 Mar 2008 22:57:47 -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; Sat, 29 Mar 2008 22:57:27 +0000 Received: from zps38.corp.google.com (zps38.corp.google.com [172.25.146.38]) by smtp-out.google.com with ESMTP id m2TMvPqU016577; Sat, 29 Mar 2008 15:57:25 -0700 Received: from smtp.corp.google.com (spacemonkey1.corp.google.com [192.168.120.115]) by zps38.corp.google.com with ESMTP id m2TMvOin007214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 29 Mar 2008 15:57:24 -0700 Received: from localhost.localdomain.google.com (adsl-76-249-168-94.dsl.pltn13.sbcglobal.net [76.249.168.94]) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id m2TMvNa1027313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 29 Mar 2008 14:57:24 -0800 To: "PRC" Cc: "gcc-help" Subject: Re: Can I force gcc not to optimize calling to leaf functions with `-O2' option? References: <200803291611208655796@gmail.com> From: Ian Lance Taylor Date: Sat, 29 Mar 2008 22:57:00 -0000 In-Reply-To: <200803291611208655796@gmail.com> (PRC's message of "Sat\, 29 Mar 2008 16\:11\:29 +0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00304.txt.bz2 "PRC" writes: > I wonder if I can inform gcc not to optimize calling to leaf functions. What you describe is not an optimization of calling leaf functions, it's an optimization when the last action a function takes is to call another function. There are a couple of names for this optimization. gcc calls it a sibling call. The option to turn it off is -fno-optimize-sibling-calls. Ian