> The lang hook is supposed to mark the variable as addressable. > The lang hook should not be changing other things that have an affect > on the *middle end*. No exceptions.
But how is it "supposed to mark the variable as addressable"? If this just means setting TREE_ADDRESSABLE, what's the point of having the hook? And if it does something *else*, how is the middle-end supposed to know how to undo it? I guess what I'm arguing for here is either the removal of the lang hook or the addition of one to set a decl *non-addressable*. As far as I'm concerned, I think the removal is better, but both are OK with me. > > Moreover, what if what you're taking the address of is a COMPONENT_REF > > or some such. Are we saying that's not allowed anymore? Some lang-hooks > > look through them to set TREE_ADDRESSABLE on the underlying decl, but > > your patch only calls it on a DECL_P. > What are you talking about? > The aliaser will remove tree addressable from DECL's if they do not > have their address taken. This includes removing addressable from "a" > if we had &a.b.c.d, it was the only address taking of a, and later > eliminated it. I'm talking about *setting* TREE_ADDRESSABLE on "a" in your example. Exactly who will do that with your patch? > > I think we need to step back a bit and get a definition we can all agree > > on here first. > > A definition of what, exactly? Of the precise relationship between TREE_ADDRESSABLE and the lang hook and the issue of how to "undo" what the hook might have done.