From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26436 invoked by alias); 4 Aug 2003 16:53:10 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26429 invoked from network); 4 Aug 2003 16:53:09 -0000 Received: from unknown (HELO nile.gnat.com) (205.232.38.5) by sources.redhat.com with SMTP; 4 Aug 2003 16:53:09 -0000 Received: by nile.gnat.com (Postfix, from userid 338) id 4018EF2D7E; Mon, 4 Aug 2003 12:53:09 -0400 (EDT) To: aoliva@redhat.com, bernds@redhat.com Subject: Re: std::pow implementation Cc: gcc@gcc.gnu.org, gdr@integrable-solutions.net, rguenth@tat.physik.uni-tuebingen.de, s.bosscher@student.tudelft.nl Message-Id: <20030804165309.4018EF2D7E@nile.gnat.com> Date: Mon, 04 Aug 2003 17:03:00 -0000 From: dewar@gnat.com (Robert Dewar) X-SW-Source: 2003-08/txt/msg00142.txt.bz2 > (*) Reasons why I'd accept inline not being honoured: > - the function would become too big for the machine (or any other reason > why the code wouldn't work) > - recursive functions > - alloca or some other feature that causes stack size explosions > is used. We should warn - this is a case for always_inline > (Likewise for any dodgy GNU extensions I'm forgetting right now) > - the compiler would explode due to lack of memory - we should make an > effort this doesn't become a frequent reason > - the programmer used -Os (and we can prove the code would get bigger) I would add - doing the inlining as requested increases both the space and execution time of the program, the former very substantially. Of course, the question is 1. Does this happen often in practice (certainly as I Have noted before we often see that -O3 slows things down compared to -O2: speed = space in the land of icaches). 2. Can the compiler really usefully tell this is the case, or does it make so many mistakes trying to be helpful in this way that it actually hurts. With regard to the "collapsing code" issue, clearly the best strategy is to do parameter substitution and collapse the code *before* deciding whether to inline it. Of course this is not so easy to do.