Bug 21181 – Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2020-08-21T07:43:07Z
Last change time
2020-08-24T03:16:09Z
Keywords
iasm, pull, wrong-code
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=2617

Comments

Comment #0 by bugzilla — 2020-08-21T07:43:07Z
The following code: uint func() { asm { naked; inc [EAX]; inc byte ptr [EAX]; inc short ptr [EAX]; inc int ptr [EAX]; inc long ptr [EAX]; } } generates: __D5test24funcFZk: inc byte ptr [EAX] inc byte ptr [EAX] inc word ptr [EAX] inc dword ptr [EAX] inc byte ptr [EAX] <== !!!!! The last instruction should be rejected by the compiler.
Comment #1 by dlang-bot — 2020-08-21T07:57:36Z
@WalterBright created dlang/dmd pull request #11601 "fix Issue 21181 - Inline Assembler compiles long ptr as a byte operati…" fixing this issue: - fix Issue 21181 - Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles https://github.com/dlang/dmd/pull/11601
Comment #2 by dlang-bot — 2020-08-24T03:16:09Z
dlang/dmd pull request #11601 "fix Issue 21181 - Inline Assembler compiles long ptr as a byte operati…" was merged into master: - 4495f6f66dd36e3547c47a464f4393c26f7f4afc by Walter Bright: fix Issue 21181 - Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles https://github.com/dlang/dmd/pull/11601