public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mendell <mendell@ca.ibm.com>
To: Mark Mitchell <mark@codesourcery.com>
Cc: Andrew_Pinski@playstation.sony.com, gcc <gcc@gcc.gnu.org>,
	        Hans-Peter Nilsson <hp@bitrange.com>,
	        Richard Guenther <richard.guenther@gmail.com>,
	        Russell_Olsen@playstation.sony.com,
	        trevor_smigiel@playstation.sony.com
Subject: Re: __builtin_expect for indirect function calls
Date: Mon, 07 Jan 2008 21:15:00 -0000	[thread overview]
Message-ID: <OFAFCA915C.26EC5659-ON852573C9.00745C20-852573C9.0074BBD2@ca.ibm.com> (raw)
In-Reply-To: <47812F74.3020905@codesourcery.com>

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 <mark@codesourcery.com>                                                                  
                                                                                                                     
  To:         Richard Guenther <richard.guenther@gmail.com>                                                          
                                                                                                                     
  Cc:         trevor_smigiel@playstation.sony.com, Hans-Peter Nilsson <hp@bitrange.com>, gcc <gcc@gcc.gnu.org>,      
              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


  reply	other threads:[~2008-01-07 21:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18  0:52 trevor_smigiel
2007-12-18  2:27 ` Jonathan Adamczewski
2007-12-22  3:42 ` Hans-Peter Nilsson
2007-12-26 19:10   ` Mark Mitchell
2008-01-03 23:36     ` trevor_smigiel
2008-01-05  5:44       ` Mark Mitchell
2008-01-05 10:40         ` Richard Guenther
2008-01-06 19:44           ` Mark Mitchell
2008-01-07 21:15             ` Mark Mendell [this message]
2008-01-08 15:36               ` Dave Korn
2008-01-08 15:51                 ` Dave Korn
2008-01-03 23:46   ` trevor_smigiel
2008-01-06 20:42 Ross Ridge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OFAFCA915C.26EC5659-ON852573C9.00745C20-852573C9.0074BBD2@ca.ibm.com \
    --to=mendell@ca.ibm.com \
    --cc=Andrew_Pinski@playstation.sony.com \
    --cc=Russell_Olsen@playstation.sony.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hp@bitrange.com \
    --cc=mark@codesourcery.com \
    --cc=richard.guenther@gmail.com \
    --cc=trevor_smigiel@playstation.sony.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).