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: [email protected]
ReportedBy: [email protected]
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.
--