From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: jay.foad@gmail.com
Subject: [Qemu-devel] [PATCH] declare saved_env_reg as volatile
Date: Tue, 23 Feb 2010 19:21:00 +0100 [thread overview]
Message-ID: <1266949260-24974-1-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <ee2e06e91002231017q24a55763t6f2d63f6938341c2@mail.gmail.com>
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>
---
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
prev parent reply other threads:[~2010-02-23 18:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 14:50 [Qemu-devel] gcc 4.4 miscompiling cpu_exec() ? Jay Foad
[not found] ` <4B840A59.3060407@aurel32.net>
2010-02-23 17:57 ` Jay Foad
2010-02-23 17:58 ` [Qemu-devel] " Paolo Bonzini
2010-02-23 18:17 ` Jay Foad
2010-02-23 18:18 ` Paolo Bonzini
2010-02-23 18:21 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266949260-24974-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=jay.foad@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).