[tree-ssa] How to make DECLs that alias

Andrew Haley aph@redhat.com
Tue Nov 18 18:48:00 GMT 2003


I have a problem that is driving me mad.

When compiling Java bytecode, we do not have the usual strictly nested
DECLs.  Instead, we have stack slots, and their lifetimes may overlap
in an non-strictly nested way.

The semantics of the Java VM allow a local variable to be anonymous (a
local variable with no associated name) in one part of a method and be
given a name later.  Indeed, a variable can change its name, although
there is no way to describe this in Java source.

In the mainline gcj compiler, we solve this by associating more than
DECL with a single DECL_RTL.  When the compiler sees an anonymous
local variable it creates an unnamed DECL for that variable.  Later,
when that variable is given a name, anther DECL is created with the
same DECL_RTL as the anonymous local variable.

With tree-SSA, I can see no way to do this.  What I really need is a
way to make a DECL refer to another DECL as an alias.  I don't think
attribute("alias") can do what I want.

Any ideas?

Andrew.



More information about the Gcc mailing list