[Issue 5885] New: wrong codegen for OPu32_d
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 25 07:36:23 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5885
Summary: wrong codegen for OPu32_d
Product: D
Version: D2
Platform: x86_64
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: dawg at dawgfoto.de
--- Comment #0 from dawg at dawgfoto.de 2011-04-25 07:32:40 PDT ---
Created an attachment (id=948)
patch
struct Value {
uint a, b;
}
double mul(Value val, double fac) {
return val.a * fac;
}
int main() {
auto a = mul(Value(10), 10.0); // seems to work as val.b == 0
auto b = mul(Value(10, 20), 10.0); // loads the 20 in the fpu
return a == b ? 0 : 1;
}
--
What happens is that the complete rdi register gets pushed and a 64 bit integer
is loaded from that address to the FPU. Maybe I'm missing something but loading
an 32 bit simplifies even the 32-bit code. See attached patch.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list