From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14816 invoked by alias); 27 Oct 2002 18:28:33 -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 14437 invoked from network); 27 Oct 2002 18:28:28 -0000 Received: from unknown (HELO fencepost.gnu.org) (199.232.76.164) by sources.redhat.com with SMTP; 27 Oct 2002 18:28:28 -0000 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.10) id 185s9E-0004IW-01 for gcc@gnu.org; Sun, 27 Oct 2002 13:28:28 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 185s99-0004Uy-00 for gcc@gnu.org; Sun, 27 Oct 2002 13:28:25 -0500 Received: from dc-mx05.cluster1.charter.net ([209.225.8.15] helo=mx05.cluster1.charter.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 185s99-0004Uf-00 for gcc@gnu.org; Sun, 27 Oct 2002 13:28:23 -0500 Received: from [66.189.16.4] (HELO grinder) by mx05.cluster1.charter.net (CommuniGate Pro SMTP 3.5.9) with SMTP id 15778732 for gcc@gnu.org; Sun, 27 Oct 2002 13:28:22 -0500 Date: Mon, 28 Oct 2002 05:30:00 -0000 From: Rob Aberg To: gcc@gnu.org Subject: Statement incorrect in doc Message-Id: <20021027132815.4b8a4d0e.roa@charter.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.6 required=5.0 tests=SPAM_PHRASE_00_01 version=2.41 X-Spam-Level: X-SW-Source: 2002-10/txt/msg01595.txt.bz2 While looking in Google for discussions on stategies for optionally inlining C functions in a semi-portable way, I ran across your online doc: http://gcc.gnu.org/onlinedocs/gcc/Inline.html The section heading is "An Inline Function is As Fast As a Macro". That's not entirely true. Often, an inline function is faster: if a macro uses its "input arg" more than once and the arg is an expression, the arg-expression is evaluated multiple times unless other optimizations in gcc are active and see the common subexpression and eliminate it. Consider this macro: #define my_min(X,Y) ( ((X) < (Y)) ? (X) : (Y) ) It will evaluate either the (X) or the (Y) expression twice. It can be arbitrarily worse for nested macros. Or am I just missing something? Now that I am reminded, I'll order this one as well -- I have the gdb book, it is very well written... Thanks, Rob Aberg Grafton, MA