History

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 815f0ddb346c ("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.

ndesaulniers@google.com committed 8 years ago

Commit fe0640e1 parent f0604f61 file · +4 −1Browse files

Unified · Split

include/linux/compiler.h+4−1
@@ -124,7 +124,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 123 unmodified lines
124124 # define ASM_UNREACHABLE
125125 #endif
126126 #ifndef unreachable
127−# define unreachable() do { annotate_reachable(); do { } while (1); } while (0)
127+# define unreachable() do { \
128+ annotate_unreachable(); \
129+ __builtin_unreachable(); \
130+} while (0)
128131 #endif
129132
130133 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t