Matti Niemenmaa wrote:
_D3foo1xi, however, does appear in it, even though it's just as unused as _D3foo3fooFZv. Why doesn't Optlink remove that? LLVM's LTO does.
It would if x was a COMDAT. The problem, though, is x is allocated as thread local which has some kludgy issues about it, as it's an afterthought in the omf.
The real issue, though, is that saving 4 bytes in your exe file won't make any difference. If you've got thousands of global variables (used or not), you've got other problems with your program.
In other words, it's what do you spend time implementing optimizations for? It should be things that matter.
