0

I am generally familiar with the sorts of optimizations performed by the -O2 or -O3 switches.

I have been bitten a couple of times now by issues that are specific to building a DLL that don't appear in writing a flat executable, so before I start turning on optimizations are there any "gotcha"s that I should be aware of?

Stephen
  • 1,607
  • 2
  • 18
  • 40
  • [Look here](http://stackoverflow.com/questions/2722302/can-compiler-optimization-introduce-bugs) – sternr Aug 23 '11 at 14:49
  • @sternr Thanks for the link, clearly optimizations can introduce bugs. I was looking for an idea about common issues that could occur with DLLs that might not be intuitive or produce hard to diagnose problems. – Stephen Aug 23 '11 at 14:52

1 Answers1

2

Dead code elimination in an EXE basically starts with main as the single root of reachability, but every exported function of a DLL is a separate root.

MSalters
  • 173,980
  • 10
  • 155
  • 350