Hello,

On Tue, 16 Sep 2025, Richard Biener wrote:

> > Do you mean TREE_READONLY or TREE_THIS_NOTRAP is a useless flag?  In my view
> > they mean different and orthogonal things.  We do propagate TREE_READONLY in
> > the inliner and the tree rewriting routines too.
> 
> I mean TREE_READONLY on ..._REF nodes.  We can't rely on the absence of 
> TREE_READONLY on ..._REF meaning the object is writable, so the flag 
> does not add any information (but maybe some costing hint that the 
> object is definitely _not_ writable(?)).

Why do you infer from 'flag missing doesn't convey info' to 'flag isn't 
useful'?  That's backwards.  _If_ the flag is there it says something, 
namely that the specific entity can't be written to.

(It may very well have similar issues like TREE_THIS_NOTRAP, being not 
flow sensitive, but the essential idea is that by just seeing the entity, 
without much context, you know that whatever gave you that entity can't 
have possibly been a write context, except perhaps in special 
circumstances, like a one-time initialisation before normal program 
start.)


Ciao,
Michael.

Reply via email to