OSDN Git Service

Fixes i386 xchgq test
authorfabrice.desclaux@cea.fr <fabrice.desclaux@cea.fr>
Fri, 7 Dec 2018 14:44:40 +0000 (15:44 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 11 Dec 2018 17:41:25 +0000 (18:41 +0100)
As "xchg" reads and writes both operands, the "+m" is required to avoid
undefined behavior on -O2 compilation.

Signed-off-by: Fabrice Desclaux <fabrice.desclaux@cea.fr>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <03506cf0-a204-f619-8ee4-4990a5e69af5@cea.fr>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
tests/tcg/i386/test-i386.c

index a29b41e..18d5609 100644 (file)
@@ -1137,7 +1137,7 @@ void test_xchg(void)
     TEST_XCHG(xchgb, "b", "+q");
 
 #if defined(__x86_64__)
-    TEST_XCHG(xchgq, "", "=m");
+    TEST_XCHG(xchgq, "", "+m");
 #endif
     TEST_XCHG(xchgl, "k", "+m");
     TEST_XCHG(xchgw, "w", "+m");