gcc loop unrolling problem ??

Robert Dewar dewar@gnat.com
Thu Feb 12 15:40:00 GMT 2004


Matt Fago wrote:

>> The number of unrollings depends on size of the loop and is bound to 8
>> maximally.  Your loop has only single instruction so you get maximal
>> unrolling.  See documentation of --param max-unrolled-insns,
>> max-unroll-times and friends.
> 
> 
> Is this also the case for loops with a constant number of iterations (my 
> loops tend to be in powers of 3)? Should the documentation mention that 
> the default value for max-unroll-times=8?

I don't see why, this is really something quite internal to the
optimizer. Obviously high values for unrolling are a bad idea that
will slow the program down. The optimal caculation of unrolling
is highly target dependent. I would guess many people increasing
this parameter would be doing so for bogus reasons :-)



More information about the Gcc mailing list