From 090ba3a2aa9bc3f6b5491b09f51b76836c014fee Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 20 Feb 2019 19:33:08 -0800 Subject: cpu_has_eflag(): mark output registers as earlyclobbers We assign values to the output registers before the input operand is used, so we have to use =&r to make sure the input operand isn't clobbered. Note: "ri" is correct; it cannot safely be a memory operand, because the stack pointer isn't where the compiler would expect it to be. Signed-off-by: H. Peter Anvin --- com32/include/x86/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com32/include/x86/cpu.h b/com32/include/x86/cpu.h index 5537da66..4bbcc802 100644 --- a/com32/include/x86/cpu.h +++ b/com32/include/x86/cpu.h @@ -25,7 +25,7 @@ static inline __constfunc bool cpu_has_eflag(unsigned long flag) "pushf ; " "pop %1 ; " "popf" - : "=r" (f1), "=r" (f2) : "ri" (flag)); + : "=&r" (f1), "=&r" (f2) : "ri" (flag)); return !!((f1 ^ f2) & flag); } -- cgit