From patchwork Tue Feb 23 18:21:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 46085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8587FB7CEC for ; Wed, 24 Feb 2010 05:21:46 +1100 (EST) Received: from localhost ([127.0.0.1]:42343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjzOB-0003PC-Gh for incoming@patchwork.ozlabs.org; Tue, 23 Feb 2010 13:21:43 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjzNe-0003P5-Ga for qemu-devel@nongnu.org; Tue, 23 Feb 2010 13:21:10 -0500 Received: from [199.232.76.173] (port=43984 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjzNd-0003Ot-4y for qemu-devel@nongnu.org; Tue, 23 Feb 2010 13:21:09 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjzNc-0004pv-GI for qemu-devel@nongnu.org; Tue, 23 Feb 2010 13:21:08 -0500 Received: from mail-ew0-f218.google.com ([209.85.219.218]:40669) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NjzNc-0004pp-6H for qemu-devel@nongnu.org; Tue, 23 Feb 2010 13:21:08 -0500 Received: by ewy10 with SMTP id 10so229177ewy.16 for ; Tue, 23 Feb 2010 10:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=YwysRlFkugh4ApWGAIsdjqpYTFD5Tda/B8knPiydDZk=; b=qOdcJCTp3obnctmRd+lNkM1iKvsuMZdqfriA/T3WsGb5Podi7hkjDJJFSpSkCi1K4I 1TubO0c7TSdb+cIS/iccXN0qWc3Ur31CDLRneA9b1BM4aUSkWzKWNVvBlECzUhPvBSGD jpHGnsvfhCtuZ/Q6Y217w0gCsuMdE/GqLe1aQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=mVpzc0tH837CGvy5mtEODlJApMA9RB67/0LUyTarKGYZ1u7KKVfP+uVLfi+Y2TxOJv ra6Q+VZp0ps8DH5ClTtOlnLT6Jxwg96Vx6jrb4I7B9VXkkoQ8BOmTXrnpdiJD1J9VwhE Y0qE31P6wc7iwnF3cgDrd1K0g108aUspgKZq8= Received: by 10.213.1.215 with SMTP id 23mr830929ebg.52.1266949267065; Tue, 23 Feb 2010 10:21:07 -0800 (PST) Received: from localhost.localdomain (93-34-208-53.ip51.fastwebnet.it [93.34.208.53]) by mx.google.com with ESMTPS id 13sm200586ewy.1.2010.02.23.10.21.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Feb 2010 10:21:05 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 23 Feb 2010 19:21:00 +0100 Message-Id: <1266949260-24974-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.6.6 In-Reply-To: References: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: jay.foad@gmail.com Subject: [Qemu-devel] [PATCH] declare saved_env_reg as volatile X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;