> Yes. So I read the comment in a way to say that TREE_THIS_NOTRAP does not > mean the reference is writable. In some context we check > > || tree_could_trap_p (lhs) > > /* tree_could_trap_p is a predicate for rvalues, so check > for readonly memory explicitly. */ > > || ((base = get_base_address (lhs)) > > && ((DECL_P (base) > && TREE_READONLY (base)) > > || TREE_CODE (base) == STRING_CST))) > > return false; > > but I guess even for !DECL_P base but tcc_reference base TREE_READONLY > could be set? I've never seen that though. Not having TREE_READONLY set > on some handled-component doesn't mean a ref is writable, right? So it's > kind of a useless flag when put on reference trees?
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. -- Eric Botcazou