|
|
|
|
|
by greglindahl
3987 days ago
|
|
This is a standard compiler feature, yes -- lots of real code out there has a lot of dead writes, such as debugging code that has been only partly removed or disabled. Historically, it's been a significant win for some of the SPECcpu benchmarks. |
|
Link-time optimization can delete a lot more stuff when you're building a program directly, since it only has to keep main()… as long as you didn't go and use things like function pointers.
This is one reason I try to use '-fvisibility=hidden' in libraries, because it prevents anything from being part of the API unless you go back and specifically export it.