|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:||"Daniel Berlin" <firstname.lastname@example.org>|
|Date:||30 Sep 2006 17:45:11 -0400|
|Posted-Date:||30 Sep 2006 17:45:11 EDT|
Edsko de Vries wrote:
> 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:
> int* global_a;
> void f()
> *global_a = 2;
> void g()
> 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;
Actually, you are using the wrong dump flags if that is all you saw.
In order to get this correct, we do *not* rename global variables.
What we do instead is to overlay a virtual ssa that describes the
aliasing and call-side effects.
use -fdump-tree-<whatever>-vops to see the virtual operands.
Return to the
Search the comp.compilers archives again.