Steven Bosscher wrote:
On Tuesday 23 August 2005 17:06, Bernd Schmidt wrote:
The idea is to put the initialization insns only on the paths where the
register will be uninitialized.
int foo (int n)
{
int a;
while (--n)
a = n;
return a;
}
Not knowing n, how can you be sure whether "a" is uninitialized for
the "return" statement or not?
In this case, assuming nothing interesting happens to the loop, you'll
have to conservatively initialize "a" near the top of the function. In
many cases you can do better and either initialize just before the use,
or initialize on an edge on which the register is uninitialized. For
register allocation purposes however, this should be as good as using
Vlad's new liveness analysis.
As Jim points out, we may have to do that for IA64 anyway, so we could
consider doing it on all targets. Dan is correct that this can
introduce new code that won't be eliminated. One question is how often
this is going to occur in practice.
Bernd