> > I wonder if we want toupdate the frontends to set addressable flag with new > > sense or we want symtab to simple set addressable on all global symbols or > > invent a new flag. > > I would preffer the first case - it seems to make most sense to me. > > I think you need to explain why this change is desirable/necessary for LTO, > this would be a good starting point. As for setting TREE_ADDRESSABLE on > every > single global symbol in every single front-end, why not, but this seems more > complicated than treating global symbols as so by default (in non-LTO mode).
In non-LTO compilation I think it would allows us to optimize bettter in the case address of the global symbol can not be taken by the other unit or it can not escape back to current unit. For C/C++ this would be for runtime generates symbols, like for gcov runtime (well if our initialization was not implemented in a way taking address of everything). For non-C languages I expect there are cases where you just can't take address of a given object. For LTO compilation this is useful for optimizing cases where variable is static at whole program optimization time, but it becomes hidden by partitioning and at whole program time we figure out its address is not taken. Honza