www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 138] New: surplus "jmp short" generated within inline assembler code

http://d.puremagic.com/bugzilla/show_bug.cgi?id=138

           Summary: surplus "jmp short" generated within inline assembler
                    code
           Product: D
           Version: 0.157
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: thomas-dloop kuehne.cn


void foo(){
        asm{
                neg     EAX;
                je      L2;
         L1:
                neg     EAX;
                jne     L1;
         L2:
                inc     EAX;
        }
}

results in:

_D1a3fooFZv:
                push    EBP
                mov     EBP,ESP
                neg     EAX
                je      LF
                jmp short       L9
L9:             neg     EAX
                jne     L9
                jmp short       LF
LF:             inc     EAX
                pop     EBP
                ret

but should be:

_D1a3fooFZv:
                push    EBP
                mov     EBP,ESP
                neg     EAX
                je      LF
L9:             neg     EAX
                jne     L9
LF:             inc     EAX
                pop     EBP
                ret


-- 
May 13 2006