]> git.proxmox.com Git - qemu.git/commitdiff
declare saved_env_reg as volatile
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 23 Feb 2010 18:21:00 +0000 (19:21 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 23 Feb 2010 19:23:29 +0000 (13:23 -0600)
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.foad@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
cpu-exec.c

index 184bddea310e6b6c68fa20a8f44fd9b16d77e5ef..5d6dd514ffed6a46d2f0a2b5dbe556485c53b9f4 100644 (file)
@@ -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;