|
From: | Paolo Bonzini |
Subject: | [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly |
Date: | Thu, 24 Feb 2011 08:58:04 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |