Avoid compiler optimizing away loops