https://issues.dlang.org/show_bug.cgi?id=21007
Issue ID: 21007
Summary: DMD generates unnecessary prolog/epilog for trivial
functions
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The code:
int square(int num) { return num * num; }
generates:
push RBP
mov RBP,RSP
mov EAX,EDI
imul EAX,EAX
pop RBP
ret
while gdc and ldc do not generate the prolog/epilog.
https://godbolt.org/z/A7EUu7
--
