tried with volatile -- O3 does not optimize away