From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5837 invoked by alias); 8 Aug 2004 19:21:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5830 invoked by uid 48); 8 Aug 2004 19:21:56 -0000 Date: Sun, 08 Aug 2004 19:21:00 -0000 From: "wwieser at gmx dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20040808192155.16922.wwieser@gmx.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16922] New: gcc inlines functions with attribute noinline X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg00582.txt.bz2 List-Id: Well, so this tricked me in some function call time measurements: In the following code... --------------------------------------- int foo(int x) __attribute__((noinline)); int main() { for(int i=0; i<0x7fffffff; i++) foo(i); } int foo(int x) { return(x); } ------------------------------------------------ ...the function foo() actually gets inlined when compiled with g++ -O2 -fno-rtti -fno-exceptions test.cc -o test.S as can be seen in the produced assembler code [...] main: pushl %ebp xorl %eax, %eax movl %esp, %ebp subl $8, %esp andl $-16, %esp subl $16, %esp .p2align 4,,15 .L6: <-- loop start incl %eax cmpl $2147483647, %eax jne .L6 <-- loop end [...] The "call foo" is missing and got optimized away. Version in question: ggc (GCC) 3.4.2 20040808 (prerelease) Wolfgang -- Summary: gcc inlines functions with attribute noinline Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: wwieser at gmx dot de CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-linux-gnu GCC host triplet: i686-linux-gnu GCC target triplet: i686-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16922