From patchwork Tue Feb 23 18:21:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: declare saved_env_reg as volatile From: Paolo Bonzini X-Patchwork-Id: 46085 Message-Id: <1266949260-24974-1-git-send-email-pbonzini@redhat.com> To: qemu-devel@nongnu.org Cc: jay.foad@gmail.com Date: Tue, 23 Feb 2010 19:21:00 +0100 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 --- 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;