[POWERPC] mark BUG() as noreturn

Segher Boessenkool segher at kernel.crashing.org
Fri Sep 22 01:15:36 EST 2006


> OTOH, it is handy to mark BUG() as not being able to return as that  
> tells the
> compiler that it doesn't have to check that the code path through  
> the BUG()
> call is complete and this means it can be more relaxed about  
> generating
> warnings about potentially unused variables and suchlike.

That's originally the main reason the noreturn attribute exists
at all.  It can also help optimise code (for size too, sure
performance isn't too interesting here); for example, the compiler
can clobber all registers it wants on the branch path jumping into
the noreturn routine (without the noreturn, it would have to save
the nonvolatiles).


Segher




More information about the Linuxppc-dev mailing list