From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32511 invoked by alias); 14 Nov 2002 22:36:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32480 invoked by uid 71); 14 Nov 2002 22:36:02 -0000 Date: Thu, 21 Nov 2002 04:06:00 -0000 Message-ID: <20021114223602.32479.qmail@sources.redhat.com> To: bkoz@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Gabriel Dos Reis Subject: Re: libstdc++/8230: Buggy allocator behaviour Reply-To: Gabriel Dos Reis X-SW-Source: 2002-11/txt/msg00739.txt.bz2 List-Id: The following reply was made to PR libstdc++/8230; it has been noted by GNATS. From: Gabriel Dos Reis To: Matt Austern Cc: Benjamin Kosnik , bkoz@gcc.gnu.org, gcc-bugs@gcc.gnu.org, jkanze@caicheuvreux.com, gcc-gnats@gcc.gnu.org, libstdc++@gcc.gnu.org, rth@redhat.com Subject: Re: libstdc++/8230: Buggy allocator behaviour Date: 14 Nov 2002 23:27:17 +0100 Matt Austern writes: [...] | > In general, I would like to see us starting using use | > __builtin_expect() | > at places where we do checks for limits cases. Thoughts? | | Two questions. | | First, is it known how much of a speedup this gives on typical | platforms? I didn't make measurements by myself but I'm trusting its implementor (RTH) :-) Maybe RTH could provide us with some datapoint here? | Second, if the answer to question 1 is "a lot": is there some sensible | way to use this in the compiler itself? I suppose it'd have to involve | some ghastly macro hackery because of the bootstrap problem, but | it we're talking big performance wins, it might be worth it. If the answer to the first question is "a lot", then I agree with you that it makes perfect sense to use it in the compiler itself. I could imagine something along the lines #if !defined(__GNUC__) || __GNUC__ < 3 /* correct the version number */ # define __builtin_expect(EXP, PROB) EXP #endif in system.h or wherever appropriate. -- Gaby