Bug 6086 – Possibly unneded functions

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-06-01T05:22:00Z
Last change time
2011-06-01T18:05:29Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-06-01T05:22:29Z
This is not a true bug, and I am not sure if this is right. This 2 lines long D2 program: void foo()() {} void main() {} Once compiled with DMD 2.053 (using no compiler switch, or using -O -release -inline is the same), generates this asm too: _D4test7__arrayZ comdat L0: enter 4,0 push EAX mov ECX,offset FLAT:_D4test12__ModuleInfoZ push ECX call near ptr __d_array_bounds _D4test8__assertFiZv comdat L0: enter 4,0 push EAX mov ECX,offset FLAT:_D4test12__ModuleInfoZ push ECX call near ptr __d_assertm _D4test15__unittest_failFiZv comdat L0: enter 4,0 push EAX mov ECX,offset FLAT:_D4test12__ModuleInfoZ push ECX call near ptr __d_unittestm add ESP,8 leave ret Is unittest_fail needed in the asm of this program?
Comment #1 by bugzilla — 2011-06-01T18:05:29Z
Compile with: dmd -O -release -map Examine the map file. Note that the "unneeded" functions are not there.