[POWERPC] mark BUG() as noreturn

Jimi Xenidis jimix at watson.ibm.com
Fri Sep 22 20:58:24 EST 2006


On Sep 21, 2006, at 8:54 PM, Michael Ellerman wrote:

> On Thu, 2006-09-21 at 08:18 -0400, Jimi Xenidis wrote:
>> On Sep 21, 2006, at 12:55 AM, Stephen Rothwell wrote:
>>
>>> From an idea from Michael Ellerman.
>>>
>>> We finish the BUG() macro with a call to a function marked with
>>> attribute
>>> "noreturn" so that the compiler will know that BUG() and BUG_ON()
>>> (with a constant, non-zero argument) will not return.
>>
>> But BUG() _can_ return, if I have a probe, xmon or kgdb configured it
>> is possible  to play with the state of the world and try to continue/
>> recover, (xmon "x" command).  IMHO, this is a powerful debugging
>> scenario.
>
> Hmm, ok I hadn't thought of that. Personally I've never tried to  
> recover
> from a BUG(), do people really do that much?
Oh, do it once and your hooked :)

>
>> Why are we concerned with the performance of this anyway?
>
> Not so much the performance, more that it gives the compiler more
> information about what's happening and allows it to elide code in some
> circumstances - but it's not _that_ important.
>
> Having it configurable might be an option, dunno.

I would not object to making depend on CONFIG_DEBUG_KERNEL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060922/297b9eff/attachment.pgp>


More information about the Linuxppc-dev mailing list