[Issue 2584] New: GDC on ARM does not honor volatile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 13 03:28:14 PST 2009


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

           Summary: GDC on ARM does not honor volatile
           Product: DGCC aka GDC
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: major
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn at users.sf.net
        ReportedBy: default_357-line at yahoo.de


In GDC on ARM, the following code

struct Test {
  uint* ptr;
  uint write(uint i) { volatile (*ptr) = i; return i; }
}

void main() {
  Test test; test.ptr = cast(uint*) 0xDEAD_BEEF;
  test.write(0); test.write(0); test.write(0);
  return;
}

generates this assembly: http://paste.dprogramming.com/dpep5uc3 .

Note how the 0 is only stored once, not thrice, in blatant violation of the
volatile.


-- 



More information about the D.gnu mailing list