Commit fe0640eb authored by ndesaulniers@google.com's avatar ndesaulniers@google.com Committed by Miguel Ojeda

compiler.h: update definition of unreachable()

Fixes the objtool warning seen with Clang:
arch/x86/mm/fault.o: warning: objtool: no_context()+0x220: unreachable
instruction

Fixes commit 815f0ddb ("include/linux/compiler*.h: make compiler-*.h
mutually exclusive")

Josh noted that the fallback definition was meant to work around a
pre-gcc-4.6 bug. GCC still needs to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365, so compiler-gcc.h
defines its own version of unreachable().  Clang and ICC can use this
shared definition.

Link: https://github.com/ClangBuiltLinux/linux/issues/204Suggested-by: default avatarAndy Lutomirski <luto@amacapital.net>
Suggested-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Tested-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
parent f0604f63
...@@ -124,7 +124,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, ...@@ -124,7 +124,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
# define ASM_UNREACHABLE # define ASM_UNREACHABLE
#endif #endif
#ifndef unreachable #ifndef unreachable
# define unreachable() do { annotate_reachable(); do { } while (1); } while (0) # define unreachable() do { \
annotate_unreachable(); \
__builtin_unreachable(); \
} while (0)
#endif #endif
/* /*
......
Markdown is supported
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