From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30671 invoked by alias); 7 Jan 2008 21:15:39 -0000 Received: (qmail 30659 invoked by uid 22791); 7 Jan 2008 21:15:39 -0000 X-Spam-Check-By: sourceware.org Received: from e2.ny.us.ibm.com (HELO e2.ny.us.ibm.com) (32.97.182.142) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 07 Jan 2008 21:15:17 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m07LFD4T030800 for ; Mon, 7 Jan 2008 16:15:13 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m07LFDFB124132 for ; Mon, 7 Jan 2008 16:15:13 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m07LFCc3008043 for ; Mon, 7 Jan 2008 16:15:13 -0500 Received: from d25ml01.torolab.ibm.com (d25ml01.torolab.ibm.com [9.26.6.102]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m07LFCJJ008020; Mon, 7 Jan 2008 16:15:12 -0500 In-Reply-To: <47812F74.3020905@codesourcery.com> References: <20071218000552.GV3656@playstation.sony.com> <20071221220630.Y67443@dair.pair.com> <4772A350.6030907@codesourcery.com> <20080103233308.GD5853@playstation.sony.com> <477F190B.2000807@codesourcery.com> <84fc9c000801050240l6918b59dpd519dea81ddd3ad@mail.gmail.com> <47812F74.3020905@codesourcery.com> Subject: Re: __builtin_expect for indirect function calls To: Mark Mitchell Cc: Andrew_Pinski@playstation.sony.com, gcc , Hans-Peter Nilsson , Richard Guenther , Russell_Olsen@playstation.sony.com, trevor_smigiel@playstation.sony.com X-Mailer: Lotus Notes Release 8.0 August 02, 2007 Message-ID: From: Mark Mendell Date: Mon, 07 Jan 2008 21:15:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII 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-01/txt/msg00056.txt.bz2 The frontends here would prefer to just implement __builtin_expect_call (fp,foo), and leave __builtin_expect as it is now. We don't see a need for a polymorphic __builtin_expect, as we are worried about backwards compatibility. A question was raised: Are side effects in the second parameter guaranteed to be executed? Is it valid for a compiler to ignore any side effects? Mark Mendell TOBEY Team Lead IBM Toronto Laboratory, 8200 Warden Ave, Markham, Ontario, Canada, L6G 1C7 Tel: 905-413-3485 Tie: 313-3485 Internet: mendell@ca.ibm.com From: Mark Mitchell To: Richard Guenther Cc: trevor_smigiel@playstation.sony.com, Hans-Peter Nilsson , gcc , Russell_Olsen@playstation.sony.com, Andrew_Pinski@playstation.sony.com, Mark Mendell/Toronto/IBM@IBMCA Date: 06/01/2008 02:42 PM Subject: Re: __builtin_expect for indirect function calls Richard Guenther wrote: >> What do people think? Do we have the leeway to change this? Or should >> we add __builtin_expect2? Or add an -fno-polymorphic-builtin-expect? >> Or...? > > I think we should simply make __builtin_expect polymorphic, but make sure > to promote integral arguments with rank less than long to long. I thought of that, but I hadn't suggested this idea because it seemed so weird. Promoting to int would not be odd, but promoting to long is weird. Anyhow, you're right; that's another option, and, despite weirdness, plausible. I can't think of a way in which it changes current behavior, unless you call __builtin_expect with a long long, and that's probably not going to do what you expect right now anyhow. -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713