Thread overview
[Issue 24264] ImportC: inliner trips on _Bool return
Dec 08, 2023
Walter Bright
Dec 08, 2023
Dlang Bot
Dec 08, 2023
Dlang Bot
December 08, 2023
https://issues.dlang.org/show_bug.cgi?id=24264

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #1 from Walter Bright <bugzilla@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

--
December 08, 2023
https://issues.dlang.org/show_bug.cgi?id=24264

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #15892 "fix Issue 24264 - ImportC: inliner trips on _Bool return" fixing this issue:

- fix Issue 24264 - ImportC: inliner trips on _Bool return

https://github.com/dlang/dmd/pull/15892

--
December 08, 2023
https://issues.dlang.org/show_bug.cgi?id=24264

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15892 "fix Issue 24264 - ImportC: inliner trips on _Bool return" was merged into master:

- 0a2b4e474a7146579d2c5a5155a66bbea2824d21 by Walter Bright:
  fix Issue 24264 - ImportC: inliner trips on _Bool return

https://github.com/dlang/dmd/pull/15892

--