The main difference there seems to be that GCC treats the if() as unlikely to be taken while the for() as likely.