www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5557] New: [64-Bit] FP (alignment?) issues with Rvalues

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5557

           Summary: [64-Bit] FP (alignment?) issues with Rvalues
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dawg dawgfoto.de



import std.stdio;

struct Temp {
  this(float ctorPar) {
  }

  this(double ctorPar) {
  }

  void buggy(float val) const {
    writeln(val);
  }

  void buggy2(double val) const {
    writeln(val);
  }

  void working(real val) const {
    writeln(val);
  }
}

void main() {
  Temp(7.f).buggy(2.);  //!<- val == ctorPar
  Temp(7.f).buggy2(0.); //!<- val is some mixup of ctorPar
  Temp(7.f).working(2.);

  Temp(7.).buggy(2.);   //!<- val == 0
  Temp(7.).buggy2(2.);  //!<- val == ctorPar
  Temp(7.).working(2.);
}

------

Only the functions taking a real gets called with the correct parameter value.
The other two are influenced by the value to the ctor.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5557


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



01:25:35 PST ---
https://github.com/D-Programming-Language/dmd/commit/3b9f611336d3d2ba9d68fb8949d70b8a0417f31e

https://github.com/D-Programming-Language/dmd/commit/479fb8254a8a3bfb15ff4dee0bcd575fd6acbc5c

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2011