[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] declare saved_env_reg as volatile

From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH] declare saved_env_reg as volatile
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: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
 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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]