lkml.org 
[lkml]   [2004]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6 patch] if ... BUG() -> BUG_ON()
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~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.027 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site