This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -funsafe-loop-optimizations
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