On Wed, 11 Jun 2014, Eric Botcazou wrote: > > Because that's not the point and because it feels like a hack ;) > > Well, if we keep the current semantics of TREE_ADDRESSABLE and decide that > the > predicate for aliasing is may_be_aliased, the implementation for the latter > becomes a detail. And it would seem better/simpler to have the knowledge > localized in this single predicate than spread over multiple files and FEs.
Sure. Still currently TREE_ADDRESSABLE on TREE_PUBLIC/DECL_EXTERNAL VAR_DECLs carries no useful information, so I consider the bit unused. I propose to add semantics for it. Btw, the optimization is not restricted to LTO but also applies to -fwhole-program (poor-mans single-TU "LTO"). So it is a property that could be computed (as Honza says) by the IPA visibility pass (in the -fwhole-program non-LTO case it promotes those decls to !TREE_PUBLIC && TREE_STATIC). Richard.