http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538
--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- > Also, is there a directive that I can use to explicitly tell GCC > to not remove a loop (without having to resort to a compiler flag > which is global, printing a variable, or using the 'volatile' keyword > which de-optimizes the caching of the target variable)? Thanks! Try to print i instead of NTH! The basic way to avoid the removal of loops in a benchmark is to consume in some way some of the computed data (in some cases the optimizer may even be clever than you think).