Bug 2109 – asm {lea EAX, [0*0+EAX]; } rejected.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-05-15T00:55:00Z
Last change time
2014-02-24T15:33:14Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2008-05-15T00:55:41Z
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
Comment #1 by bugzilla — 2008-05-22T05:07:23Z
Fixed dmd 2.014