[Issue 807] New: inout params don't mesh with fpu
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 6 17:38:31 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=807
Summary: inout params don't mesh with fpu
Product: D
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: default_357-line at yahoo.de
http://paste.dprogramming.com/dpdd066k.php
When putting inout real parameters directly on the floating point stack, doing
stuff and popping them back, for some reason the parameter doesn't get changed.
Verified on win32/mingw-gdc0.21svn and linux/dmd1.0
Update (5 minutes later)
This is beyond odd. I've got an inout variable changing addresses.
Replace the test function in the paste with
void test(inout real r) {
version(Tango) (new DisplayWriter(Cout))("Before: r is
"c)(cast(int)cast(void*)&r)("\n"c)();
else writefln("Before: r is ")(cast(void*)(&r));
asm { fld r; fsin; fstp r; }
version(Tango) (new DisplayWriter(Cout))("After: r is
"c)(cast(int)cast(void*)&r)("\n"c)();
else writefln("After: r is ")(cast(void*)(&r));
}
I got the following output: "Before: r is <someaddress>" "After: r is 0"
Please enlighten me.
Greetings
--
More information about the Digitalmars-d-bugs
mailing list