Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clang: work around asm output constraint problems

Work around clang problems with "=rm" asm constraint.

clang seems to always chose the memory output, while it is almost
always the worst choice.

Add ASM_OUTPUT_RM so that we can replace "=rm" constraint
where it matters for clang, while not penalizing gcc.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Eric Dumazet and committed by
Linus Torvalds
4cc5373f f67e8a5e

+3 -1
+1
include/linux/compiler-clang.h
··· 145 145 */ 146 146 #define ASM_INPUT_G "ir" 147 147 #define ASM_INPUT_RM "r" 148 + #define ASM_OUTPUT_RM "=r" 148 149 149 150 /* 150 151 * Declare compiler support for __typeof_unqual__() operator.
+2 -1
include/linux/compiler_types.h
··· 548 548 549 549 /* 550 550 * Clang has trouble with constraints with multiple 551 - * alternative behaviors (mainly "g" and "rm"). 551 + * alternative behaviors ("g" , "rm" and "=rm"). 552 552 */ 553 553 #ifndef ASM_INPUT_G 554 554 #define ASM_INPUT_G "g" 555 555 #define ASM_INPUT_RM "rm" 556 + #define ASM_OUTPUT_RM "=rm" 556 557 #endif 557 558 558 559 #ifdef CONFIG_CC_HAS_ASM_INLINE