This is the mail archive of the
mailing list for the GCC project.
On Fri, May 10, 2002 at 12:32:56AM +0100, Jason Merrill wrote:
> Hmm, that's pretty much what I want to say about the vfield in a class;
> it's not in read-only memory, but I assert that any time we look it up it
> will always have the same value.
Ah. I thought you were talking about reading from the vtable,
not reading the field in the object. Though I suppose the one
doesn't do you much good without the other.
> Of course, that's not true until the object is fully constructed, and
> inlined constructors could cause trouble. And have, in my experimentation
> with TREE_CONSTANT; g++.rfg/21027_14+.C was misoptimized because I was
> assigning multiple times to an UNCHANGING location.
Yep. I don't know of a solution that handles that.
> Hmm. Perhaps what I want is, rather, to tell the optimizer that the value
> will not change behind its back; that the assignments we can see are all
> there is. That it can change, but cannot alias. Which sounds like pretty
> much the same magic alias set.
No, that's different.