This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] How to make DECLs that alias


Richard Henderson wrote:

If you can somehow create a decl for a stack slot, and use it
for all the things a stack slot can hold, that might solve your
problem.  E.g. use a union.

That's not the problem - I don't think we don't need a union. Thanks to bytecode verification (which is needed to generate acceptable code, not just for security), we know the type of any slot at all times. (At least we know the mode. Object references are trickier, especially with interface types.)

Could we use whatever mechanism C++ references use?

I.e. suppose bytecode verification gives us that local variable
number 4 has type int (within a region of interest).  We later
see variable declarations "x" and "y" that map to slot 4.

Then represent this as:
  jint __local_4_as_int;
  jint& x = __local_4_as_int;
  jint& y = __local_4_as_int;
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]