(a) // Oops - compiler could reorder // writes like this. R = true; for( int i=0; i<n; i++ ) M[i] = ...; (b) // Oops - compiler hoists loop invariant! int t = R; while( t==0 ) continue; for( int i=0; i<n; i++ ) ... = M[i];