[Issue 2109] New: asm {lea EAX, [0*0+EAX]; } rejected.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 14 22:55:42 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2109

           Summary: asm {lea EAX, [0*0+EAX]; }  rejected.
           Product: D
           Version: 1.028
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


It seems there's (correctly) a check for multiplying an index register by 0.
But it is incorrectly rejecting any multiply of a constant by 0.

    asm {lea EAX, [0*4+EAX]; } // fails ("bad operand").
    asm {lea EAX, [4*0+EAX]; } // fails ("bad operand").
    asm {lea EAX, [EAX+4*0]; } // fails ("bad operand").
    asm {lea EAX, [0+EAX]; } // OK
    asm {lea EAX, [7*7+EAX]; } // OK

Only known workaround is to replace 0*X with 0.
This is painful in autogenerated code


-- 



More information about the Digitalmars-d-bugs mailing list