[Issue 5556] New: [64-bit] Wrong Implicit Conversion to Double
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 9 19:59:22 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5556
Summary: [64-bit] Wrong Implicit Conversion to Double
Product: D
Version: D2
Platform: x86_64
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: dsimcha at yahoo.com
--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2011-02-09 19:56:56 PST ---
The following weird result happens only with -m64 enabled. To reproduce the
bug from this test case, -inline must be disabled to prevent the two functions
from being inlined, though in the more complex cases that I reduced it from
inlining could be enabled.
import std.stdio;
float fun(float[] data, sizediff_t k) {
stderr.writeln("Returning ", data[k]); // Prints "Returning 2"
return data[k];
}
double gun(float[] data) {
return fun(data, data.length / 2);
}
void main() {
float[] test = [1,4,2,3,5];
stderr.writeln(gun(test)); // Prints 5.30499e-215
}
--
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