This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Memory aliasing and stack slots
- To: bosch at gnat dot com
- Subject: Re: Memory aliasing and stack slots
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sun, 28 May 00 08:59:26 EDT
- Cc: gcc at gcc dot gnu dot org
If X and Y share the same stack slot, it seems to me that they should be
in the same alias set.
The alias set of an object is determined by its type and two objects of
different types can be assigned the same stack slot at different times.
Do you know if it is possible to determine that X and Y share the
same stack slot?
In general it's not. Consider taking the address and passing it
through a const function that returns a pointer to the stucture.