D-Programming-Language/dmd — pull request #3375 by Trass3r (2014-03-11 18:03:27+00:00)
Title: do dead code elimination in release with debug info mode

dmd -v -release -m64 test.d
link.exe /NOLOGO test /OPT:NOICF

There's an implicit /OPT:REF involved.

dmd -v -release -g -m64 test.d
link.exe /NOLOGO test /DEBUG /OPT:NOICF

/DEBUG implies /OPT:NOREF /OPT:NOICF thus we need to enable it again.

The /OPT:NOICF is coming from sc.ini btw to prevent merging EH sections. Was very puzzling for me.