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]

Memory aliasing and stack slots


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.

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