News for hackers. Stuff that matters.
Re:What I learned from my first C coding challenge by exDM69 on Tuesday September 04, 2012 @05:06PM (#4476529)
> The compiler optimizing out the loop completely is one of the reasons why I didn't turn on optimizations here

Use a non-constant value for the loop and put a dummy load inside to stop compiler from doing loop unrolling and/or dead code elimination.

I often use time(), rand() or even argc to get dummy values when looking at assembly from compiler optimizations.

There are no comments on this comment yet.