make loop counter volatile to prevent gcc4.1 from optimizing away entire loop body