-funsafe-loop-optimizations
Giovanni Bajo
giovannibajo@libero.it
Sun Jan 2 00:09:00 GMT 2005
Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
>> Another idea: why don't you generate both the safe and the unsafe
>> code testing at runtime for the condition (e.g. n==0)? This is also
>> what we do in autovect to test for aligned/unaligned access. We
>> could use this new optimization flag to disable generate of the safe
>> version of the loop, but we would still be generating decent loop
>> with the default options.
>
> I have thought about this. But the runtime checks are not for free,
> and increase in code size also would not be insignificant.
Yes, this is why we could have a switch to disable generation of the runtime
checks. Still, I think that the overhead of runtime checks done once per loop
and "cold" code size increase are still bearable. I hope you will give it a
try.
Giovanni Bajo
More information about the Gcc
mailing list