[Issue 21181] New: Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 21 07:43:07 UTC 2020


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

          Issue ID: 21181
           Summary: Inline Assmbler compiles long ptr as a byte operation
                    for 32 bit compiles
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

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.

--


More information about the Digitalmars-d-bugs mailing list