This ensures that the compiler does not move it away from the "env = env1;" assignment. Fixes a miscompilation on gcc 4.4, reported by Jay Foad.
Cc: <jay.f...@gmail.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- cpu-exec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 51aa416..8721684 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -215,7 +215,7 @@ static void cpu_handle_debug_exception(CPUState *env) int cpu_exec(CPUState *env1) { - host_reg_t saved_env_reg; + volatile host_reg_t saved_env_reg; int ret, interrupt_request; TranslationBlock *tb; uint8_t *tc_ptr; -- 1.6.6