This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Memory aliasing and stack slots
- To: gcc at gcc dot gnu dot org
- Subject: Memory aliasing and stack slots
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sun, 28 May 00 08:19:18 EDT
I have a concern with the reuse of stack slots and memory aliasing.
Suppose we have a case where there are two lexical blocks within the same
basic block and we have something like:
{
struct bar x;
x = ...
... x ...
}
{
struct foo y;
y = ...
... y ...
}
Presumably, at least in some languages, X and Y will have different alias
sets, so they won't conflict. But that means that we might move load of X
until after a store of Y, which is wrong.
We have exactly the same problem with having read-only stack slots, but it
will be much rarer.
Is there any good suggestion to fix this? Perhaps we could put some note in
the insn stream when a stack slot dies, but that's a lot of notes.