public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: rridge@csclub.uwaterloo.ca (Ross Ridge)
To: gcc@gcc.gnu.org
Subject: Re: __builtin_expect for indirect function calls
Date: Sun, 06 Jan 2008 20:42:00 -0000	[thread overview]
Message-ID: <20080106204140.3F89B73D49@caffeine.csclub.uwaterloo.ca> (raw)

Mark Mitchell writes:
> What do people think?  Do we have the leeway to change this?

If it were just cases where using __builtin_expect is pointless that
would break, like function overloading and sizeof then I don't think
it would be a problem.  However, it would change behaviour when C++
conversion operators are used and I can see these being legitimately
used with __builtin_expect.  Something like:

	struct C {
		operator long();
	};

	int foo() {
		if (__builtin_expect(C(), 0))
			return 1;
		return 2;
	}

If cases like these are rare enough it's probably an acceptable change
if they give an error because the argument types don't match.

					Ross Ridge

             reply	other threads:[~2008-01-06 20:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-06 20:42 Ross Ridge [this message]
  -- strict thread matches above, loose matches on Subject: below --
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
2008-01-08 15:36               ` Dave Korn
2008-01-08 15:51                 ` Dave Korn
2008-01-03 23:46   ` trevor_smigiel

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=20080106204140.3F89B73D49@caffeine.csclub.uwaterloo.ca \
    --to=rridge@csclub.uwaterloo.ca \
    --cc=gcc@gcc.gnu.org \
    /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).