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

--- Comment #0 from David Simcha <> 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:
------- You are receiving this mail because: -------

Reply via email to