[Issue 24264] ImportC: inliner trips on _Bool return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 8 07:09:20 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24264

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
The code generated for symIso() is wrong:

0000:   55                       push      RBP
0001:   48 8B EC                 mov       RBP,RSP
0004:   48 83 EC 10              sub       RSP,010h
0008:   48 89 7D F8              mov       -8[RBP],RDI
000c:   83 7D FC 00              cmp       dword ptr -4[RBP],0
0010:   0F 95 C0                 setnz     AL // !!!
0013:   C9                       leave
0014:   C3                       ret

It should be setz. Curiously, the same code in D gets it right:

0000:   55                       push      RBP
0001:   48 8B EC                 mov       RBP,RSP
0004:   48 83 EC 10              sub       RSP,010h
0008:   48 89 7D F8              mov       -8[RBP],RDI
000c:   83 7D FC 00              cmp       dword ptr -4[RBP],0
0010:   0F 94 C0                 setz      AL  // correct
0013:   C9                       leave
0014:   C3                       ret

--


More information about the Digitalmars-d-bugs mailing list