dgorur wrote: > Hi, > > I've been getting unpredictable results with gcc -funroll-loops. As the other reply suggested, you can't expect consistent results when working on uninitialized data, and no amount of code tuning will compensate for it. I wonder about your selection of time(); as you're not threading, and appear to be interested in comparing code execution times, why not clock() ? An obvious question, which you could answer better for yourself, as you have chosen such a quirky version of gcc, is whether -funroll-loops is producing the apparently desired result of unrolling the inner loop fully. If not, why not use --param max-unroll-times=6 (3,2) to set a more suitable amount of unrolling?