From: Laurent Vivier <laur...@vivier.eu> Force the computing of the flags before negx as negx will keep Z flag from previous instructions if result is non zero.
Seen with gcc testsuite, gcc.c-torture/execute/builtin-bitops-1.c Signed-off-by: Laurent Vivier <laur...@vivier.eu> --- target-m68k/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 7d0b790..e9b6abc 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -1896,6 +1896,7 @@ DISAS_INSN(negx) int opsize; opsize = insn_opsize(insn, 6); + gen_flush_flags(s); SRC_EA(src, opsize, -1, &addr); dest = tcg_temp_new(); switch(opsize) { -- 1.7.2.3