Bug 21007 – DMD generates unnecessary prolog/epilog for trivial functions

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-07-02T00:42:42Z
Last change time
2024-12-13T19:09:53Z
Keywords
backend, performance
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#19739 →

Comments

Comment #0 by bugzilla — 2020-07-02T00:42:42Z
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
Comment #1 by robert.schadek — 2024-12-13T19:09:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19739 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB