[Issue 5564] New: [64-bit] loading of wrong constant byte value

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 11 18:38:38 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5564

           Summary: [64-bit] loading of wrong constant byte value
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dawg at dawgfoto.de


--- Comment #0 from dawg at dawgfoto.de 2011-02-11 18:36:08 PST ---
struct Temp
{
  bool value;
  this(int, bool value) {
    this.value = value;
  }
};

enum asserting = 255; //!<- anything below 256 will assert
enum working = 256; //!<- anything above is fine

void main() {
  assert(Temp(asserting, false).value == false);
}

---

In the constructor the bool is loaded from SIL which contains a non-zero value.
I wonder why movregconst at cgen.c(610):

                if (r < 4 && ((regcon.immed.value[r] >> 8) & 0xFF) == value)
                {   c = genregs(c,0x8A,reg,r | 4);      // MOV regL,rH
                    goto L2;
                }

is generating a MOV dh, dh before calling the constructor.

-- 
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