Hi Alexandre & Archie,
>I think you really need to make the pointer volatile to prevent the dereference from being optimized out.
Making a pointer volatile:
int * volatile p;
Making what the pointer points to volatile:
volatile int * p;
I presume the former is the prerequisite magic voodoo, and that between the two they may optimize differently. (I haven't actually tested the theory. Just wanted to point it out for Archie.)
Sincerely, --Eljay