From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47070 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsW5S-0005Kg-CY for qemu-devel@nongnu.org; Thu, 24 Feb 2011 02:58:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsW5Q-0006dR-Mx for qemu-devel@nongnu.org; Thu, 24 Feb 2011 02:58:09 -0500 Received: from mail-ew0-f45.google.com ([209.85.215.45]:60479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsW5Q-0006d2-Ho for qemu-devel@nongnu.org; Thu, 24 Feb 2011 02:58:08 -0500 Received: by ewy24 with SMTP id 24so95189ewy.4 for ; Wed, 23 Feb 2011 23:58:07 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4D660F8C.3030406@redhat.com> Date: Thu, 24 Feb 2011 08:58:04 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <8b675b6ffee29ec15f2b73a9fd47e334429f5c5c.1298492768.git.quintela@redhat.com> <4D6587C7.6030604@codemonkey.ws> <4D659295.1070400@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, quintela@redhat.com On 02/24/2011 08:09 AM, Markus Armbruster wrote: > For completeness: a local variable may be necessary to convince the > optimizer that the value doesn't change. Cases where this matters > exist, but they're rare. In particular, for non-pointers they're nonexistent if the variable is static and you never use ¤t_migration, i.e. if the variable doesn't escape. If the above conditions are satisfied and you have a loop that never "leaves" the C file, you could even see the compiler keep the variable in a register for the whole duration of the loop and store the modified change after the loop. Paolo