From f64b888f788278bd703f568fa01185cce7615818 Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Mon, 28 Dec 2015 23:28:17 -0500 Subject: [PATCH] Make dyngen_barrier() stronger on x86 GCC 5 will optimize out an empty 'asm volatile' in op_sraw_T0_T1, and then give us multiple return points. Add a nop so it doesn't do this, at the cost of lower code density. --- SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h b/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h index 8c12fe6b..bf772a58 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h +++ b/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h @@ -61,7 +61,11 @@ #endif // Force only one return point +#if defined(__i386__) || defined(__x86_64__) +#define dyngen_barrier() asm volatile ("nop") +#else #define dyngen_barrier() asm volatile ("") +#endif #ifndef OPPROTO #define OPPROTO