This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Loop unrolling: black magic or stochastic process?


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]