Skip to contentSkip to conversation

fix for TEST_BSX in test-i386.c

Qemu-devel Zeev Tarantov 1 participant 1 message Sep 12, 2008

lore
Share & tools
lore
#0 lore raw

Hello!

On GCC 4.3.1 with any optimization level higher than -O0, I get syntax errors for test_bsx() in test-i386.c. The following patch fixes the problem and tests pass. I assume gcc-3.3 didn't have any problems with this code, but I believe my patch is objectively correct.

test-i386.c (working copy) renamed from test-i386.c (revision 5199) +2 -2
@@ -716,8 +716,8 @@
     asm("xor %1, %1\n"\
         "mov $0x12345678, %0\n"\
         #op " %" size "2, %" size "0 ; setz %b1" \
-        : "=r" (res), "=q" (resz)\
-        : "g" (val));\
+        : "=&r" (res), "=&q" (resz)\
+        : "r" (val));\
     printf("%-10s A=" FMTLX " R=" FMTLX " %ld\n", #op, val, res, resz);\
 }
 

-Zeev