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]

TREE_UNCHANGING?


I would like to be able to tell the backend that the vtable for a class
object will never change, regardless of anything else we might or might not
know about that object, so we can hoist vtable lookups out of loops.
Unfortunately, there doesn't seem to be any way to do this in the trees;
TREE_READONLY isn't strong enough (since something const might still be
modified behind our backs), and TREE_CONSTANT is too strong (since the
value depends on which object we're dealing with).  What I want to express
is, I believe, the same concept as RTX_UNCHANGING on a MEM; asserting that
the value at a particular memory location will not change, without saying
anything about how the location is calculated.

It seems that setting TREE_CONSTANT on the INDIRECT_REF does what I want,
thanks to the check in set_mem_attributes; would it make sense to bless
this usage?

Jason


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