Some compilers, like gcc, will detect that it's an empty for loop and specifically pessimize for that, with the expectation that you put it in there as a delay loop. You can read more about that at http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Non_002dbugs.html
Mind you, this is compiler specific, so don't count on it with all compilers.