Skip to content
Commit 38938c87 authored by David Daney's avatar David Daney Committed by Linus Torvalds
Browse files

Add support for GCC-4.5's __builtin_unreachable() to compiler.h (v2)



Starting with version 4.5, GCC has a new built-in function
__builtin_unreachable() that can be used in places like the kernel's
BUG() where inline assembly is used to transfer control flow.  This
eliminated the need for an endless loop in these places.

The patch adds a new macro 'unreachable()' that will expand to either
__builtin_unreachable() or an endless loop depending on the compiler
version.

Change from v1: Simplify unreachable() for non-GCC 4.5 case.

Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 22763c5c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment