Commit 4cc5373f authored by Eric Dumazet's avatar Eric Dumazet Committed by Linus Torvalds
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Suggested-by: default avatarUros Bizjak <ubizjak@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f67e8a5e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@
 */
#define ASM_INPUT_G "ir"
#define ASM_INPUT_RM "r"
#define ASM_OUTPUT_RM "=r"

/*
 * Declare compiler support for __typeof_unqual__() operator.
+2 −1
Original line number Diff line number Diff line
@@ -548,11 +548,12 @@ struct ftrace_likely_data {

/*
 * Clang has trouble with constraints with multiple
 * alternative behaviors (mainly "g" and "rm").
 * alternative behaviors ("g" , "rm" and "=rm").
 */
#ifndef ASM_INPUT_G
  #define ASM_INPUT_G "g"
  #define ASM_INPUT_RM "rm"
  #define ASM_OUTPUT_RM "=rm"
#endif

#ifdef CONFIG_CC_HAS_ASM_INLINE