This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_expect for indirect function calls
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: trevor_smigiel at playstation dot sony dot com, Hans-Peter Nilsson <hp at bitrange dot com>, gcc <gcc at gcc dot gnu dot org>, Russell_Olsen at playstation dot sony dot com, Andrew_Pinski at playstation dot sony dot com, Mark Mendell <mendell at ca dot ibm dot com>
- Date: Sun, 06 Jan 2008 11:43:48 -0800
- Subject: Re: __builtin_expect for indirect function calls
- 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>
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