Re: Gforth and gcc "progress"



Bernd Paysan <bernd.paysan@xxxxxx> wrote:

There are a number of complications with this sort of split lifetime
register allocators, especially since debuggers have problems to
localize values when they change their position during the program
flow. One interim solution is to disable this sort of optimization
when debugging.

With the move to static single assignment form (aka SSA), gcc
effectively does this anyway. A prgram like this:

int poo (int N, int M, int I)
{
int a, b;

a = N;
a = a + M ;
a = a * 7;
b = (I - a);
b = b * b;
return a ^ b;
}

gets translated to:

poo (N, M, I)
{
int a.26;
int b;
int a;

a = N + M;
a.26 = a * 7;
b = I - a.26;
return a.26 ^ b * b;
}

where every assignment creates a separate temporary variable.

Andrew.
.