Messages in this thread |  | | From | David Howells <> | Subject | Re: [PATCH RESEND] bug: When !CONFIG_BUG, simplify WARN_ON_ONCE and family | Date | Mon, 24 Feb 2014 12:09:11 +0000 |
| |
Josh Triplett <josh@joshtriplett.org> wrote:
> > This means we actually want BUG() to end with __builtin_unreachable() > > as in the CONFIG_BUG=y case, and also ensure it actually is > > unreachable. As I have shown in [1], the there is a small overhead > > of doing this in terms of code size. > > I agree that allowing BUG() to become a no-op seems suboptimal, if only > because of the resulting warnings and mis-optimizations. However, I > think the overhead could be cut down massively, such that BUG() just > compiles down to a one-byte undefined instruction. (__builtin_trap() > might do the right thing here; worth checking.)
Is it possible to use an inline function with an empty body in this? Let the compiler prune away all the arguments?
David
|  |