This got me the other day and its something that other compilers dont always do and that is the complete removal of timing delay loops such as
{int sum=0;
int ix;
for (ix=0;ix!=10000;ix++)
sum+= something;
}
if sum can provably be shown not to be visible outside the loop ,and the loop can be shown to be finite gcc will remove the loop.
this was something that didnt happen in earlier versions of GCC because it was assumed,quite rightly that the only reason you would have an 'empty'loop was for timing.