[Issue 2584] GDC on ARM does not honor volatile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 10 03:02:12 PDT 2012


Iain Buclaw <ibuclaw at ubuntu.com> changed:

           What    |Removed                     |Added
         Resolution|INVALID                     |FIXED

--- Comment #6 from Iain Buclaw <ibuclaw at ubuntu.com> 2012-10-10 02:37:40 PDT ---

The D2-way of doing this is by using shared.

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

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

Also guarantees that (*ptr) is stored thrice also.

        ldr     r3, .L6
        mov     r0, #0
        str     r0, [r3]
        str     r0, [r3]
        str     r0, [r3]
        bx      lr


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

More information about the D.gnu mailing list