D generates large assembly for simple function

Seb seb at wilzba.ch
Sun Jan 28 01:05:44 UTC 2018


On Saturday, 27 January 2018 at 19:43:50 UTC, Stefan Koch wrote:
> On Saturday, 27 January 2018 at 19:42:01 UTC, Matt wrote:
>> Godbolt link: https://godbolt.org/g/t5S976
> The actual code is :
>  imul edi, edi
>  mov eax, edi
>  ret
>
>
> The rest is runtime initialization.
> which you can remove using an undocumented -betterC switch.

It's not undocumented:

https://dlang.org/spec/betterc.html


More information about the Digitalmars-d-learn mailing list