|SSA in the presence of procedure calls email@example.com (Edsko de Vries) (2006-09-28)|
|Re: SSA in the presence of procedure calls firstname.lastname@example.org (Diego Novillo) (2006-09-30)|
|Re: SSA in the presence of procedure calls email@example.com (Daniel Berlin) (2006-09-30)|
|From:||"Edsko de Vries" <firstname.lastname@example.org>|
|Date:||28 Sep 2006 22:51:51 -0400|
|Keywords:||SSA, analysis, question|
I have been trying to find some references about this problem, but so
far have found none. If anyone can provide me with any pointers (papers
or books), I'd appreciate it.
The problem is trying to convert a program to SSA form, in the presence
of procedure calls. Consider the following example:
*global_a = 2;
int a, b;
global_a = &a;
a = 1;
b = a;
How do I translate g() into SSA form? The problem is, of course, the
last assignment - what subscript do we give to a? Do we need to insert
a phi-function after the call to f (since without interprocedural
analysis we have no way of knowing whether f does or does not modify
a)? Let me emphasize that I'm not looking for an interprocedural SSA: a
"simple" intraprocedural SSA is okay, but I need to be able to deal
with function calls.
To my surprise, gcc simply generated
a.0 = 1;
b.0 = a.0;
But to my mind, this is simply wrong, because this would imply that the
value of b after the call to f must be equal to the value of a before
the call to f, which is not true (of course, gcc does eventually
generate correct code) - it seems to violate the most basic condition
of SSA that every variable must have a uniquely identified assignment.
Return to the
Search the comp.compilers archives again.