> Yes please.  Can we assert the MEM_REF offset is zero and the MEM_REF
> isn't type-punning, aka TREE_TYPE of the MEM_REF is compatible with
> the decls type, or is this not easily possible (again because of the
> placeholders)?

Yes for the offset, but no for the type punning because we allow it for these 
types (they have the "may_alias" attribute).

> But the subprogram invocation would be guarded with a check for writability.

How do you write a run-time check for writability in GENERIC though?  If the 
program invokes a subprogram that contains an executable store on an object 
that is a read-only memory, then execution is erroneous.  Note that the doc of 
TREE_THIS_NOTRAP suggests that it is orthogonal to readonly considerations.

> The issue is that TREE_THIS_NOTRAP is "global" and not flow-sensitive.

Yes, that's the reason for all this game.

-- 
Eric Botcazou


Reply via email to