do dead code elimination in release with debug info mode
Merge pull request #3375 from Trass3r/optref

do dead code elimination in release with debug info mode