Bug 1488 – Bad code generation when using tuple from asm
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-09-09T15:32:00Z
Last change time
2014-02-16T15:23:32Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2007-09-09T15:32:05Z
I believe this used to work with DMD 1.020. Now it definitely generates bad code.
If you leave off the "int ptr" you get a compile-time segfault (that's bug #1125).
--------------
int f(X...)(X x)
{
asm {
// mov EAX, int ptr x[0]; // OK -- sets EAX = 123
mov EAX, int ptr x[1]; // sets EAX = 0x80000001.
}
}
void main()
{
assert(456 == f(123, 456));
}
Comment #1 by clugdbug — 2007-09-13T07:03:13Z
This isn't actually a regression. It generated bad code in DMD 1.020 too.