public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Adrian Bunk <bunk@fs.tum.de>,
	akpm@osdl.org, linux-kernel@vger.kernel.org,
	eike-kernel@sf-tec.de, torvalds@osdl.org
Subject: Re: [2.6 patch] if ... BUG() -> BUG_ON()
Date: Wed, 14 Jan 2004 21:05:26 -0800	[thread overview]
Message-ID: <20040115050526.GA1883@twiddle.net> (raw)
In-Reply-To: <20040115102048.4689664e.rusty@rustcorp.com.au>

On Thu, Jan 15, 2004 at 10:20:48AM +1100, Rusty Russell wrote:
> The right fix is to hack gcc to allow functions (in this case, BUG()) to have
> an "unlikely" attribute, and therefore know that this branch is unlikely.

The minimal change to make this work is some new annotation that says
that control does not fall through an asm.  Or give up on the keen-o
diagnostics and use __builtin_trap ().

Either way, branches that lead to dead ends (such as trap or abort or
any other noreturn function) are automatically predicted not taken.


r~

  reply	other threads:[~2004-01-15  5:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 21:32 [2.6 patch] if ... BUG() -> BUG_ON() Adrian Bunk
2004-01-14 23:20 ` Rusty Russell
2004-01-15  5:05   ` Richard Henderson [this message]
2004-01-15 22:46   ` Anton Blanchard

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=20040115050526.GA1883@twiddle.net \
    --to=rth@twiddle.net \
    --cc=akpm@osdl.org \
    --cc=bunk@fs.tum.de \
    --cc=eike-kernel@sf-tec.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@osdl.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