From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18810 invoked by alias); 6 Feb 2008 23:59:41 -0000 Received: (qmail 18798 invoked by uid 22791); 6 Feb 2008 23:59:41 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Feb 2008 23:59:24 +0000 Received: (qmail 21696 invoked from network); 6 Feb 2008 23:59:22 -0000 Received: from unknown (HELO ?192.168.0.2?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Feb 2008 23:59:22 -0000 Message-ID: <47AA49D9.7010900@codesourcery.com> Date: Wed, 06 Feb 2008 23:59:00 -0000 From: Mark Mitchell User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Richard Guenther CC: Hans-Peter Nilsson , gcc@gcc.gnu.org Subject: Re: How to stop gcc from not calling noinline functions References: <200801120620.m0C6K3p1013168@ignucius.se.axis.com> <84fc9c000801120322w21679354v187fa80d2a262bc7@mail.gmail.com> In-Reply-To: <84fc9c000801120322w21679354v187fa80d2a262bc7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2008-02/txt/msg00105.txt.bz2 Richard Guenther wrote: > You can apart from the other suggestions also mark the function weak > which will prevent both inlining and pure/const analysis. How about just writing to a volatile variable from within the callee? void f() __attribute__((noinline)) { volatile int i; i = 3; } void g() { f(); } A valid GNU C compiler cannot eliminate the call to "f", as long as the call itself is reachable. -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713