diff options
author | Chris Zankel <chris@zankel.net> | 2016-01-21 05:16:13 +0000 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2016-01-21 05:16:13 +0000 |
commit | d1208404dd477c142680437137c9996b95bfd508 (patch) | |
tree | 0cba53f59f487c0de2b1a0d9fb1b11ae27de96ec /include/linux/compiler-gcc.h | |
parent | afaa7c542cc9c4d8a99ba252a8ea5e8bc7c897e2 (diff) | |
parent | afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc (diff) | |
download | talos-op-linux-d1208404dd477c142680437137c9996b95bfd508.tar.gz talos-op-linux-d1208404dd477c142680437137c9996b95bfd508.zip |
Merge tag 'v4.4'
Linux 4.4
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r-- | include/linux/compiler-gcc.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 8efb40e61d6e..22ab246feed3 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -205,11 +205,31 @@ #if GCC_VERSION >= 40600 /* - * Tell the optimizer that something else uses this function or variable. + * When used with Link Time Optimization, gcc can optimize away C functions or + * variables which are referenced only from assembly code. __visible tells the + * optimizer that something else uses this function or variable, thus preventing + * this. */ #define __visible __attribute__((externally_visible)) #endif + +#if GCC_VERSION >= 40900 && !defined(__CHECKER__) +/* + * __assume_aligned(n, k): Tell the optimizer that the returned + * pointer can be assumed to be k modulo n. The second argument is + * optional (default 0), so we use a variadic macro to make the + * shorthand. + * + * Beware: Do not apply this to functions which may return + * ERR_PTRs. Also, it is probably unwise to apply it to functions + * returning extra information in the low bits (but in that case the + * compiler should see some alignment anyway, when the return value is + * massaged by 'flags = ptr & 3; ptr &= ~3;'). + */ +#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) +#endif + /* * GCC 'asm goto' miscompiles certain code sequences: * |