From 1d9000e8238ffc346b0a08f4c0619c4e5711a7dc Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 23 Feb 2010 19:21:00 +0100 Subject: declare saved_env_reg as volatile 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: Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori --- cpu-exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu-exec.c') diff --git a/cpu-exec.c b/cpu-exec.c index 184bdde..5d6dd51 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -210,7 +210,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; -- cgit v1.1