This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc 3.1 performance regressions with respect to 2.95.3
>> Gcc 3.1 is slower in the areas: E exception handling, L loop
>> overhead, G io and S Stepanov.
The loop/Stepanov slowdown is an optimizer bug which also affects C. For
the loop in
double accumulate(double* first, double* last, double result)
{
for (; first != last; ++first)
result += *first;
return result;
}
we used to produce
cmpl %edx,%eax
je .L4
.L6:
faddl (%eax)
addl $8,%eax
cmpl %edx,%eax
jne .L6
.L4:
but now we produce
.L9:
cmpl %edx, %eax
je .L8
faddl (%eax)
addl $8, %eax
jmp .L9
.L8:
which is one insn shorter but about 20% slower on i686. This pessimization
seems to be performed by the flow2 pass; until that point the rtl looks
like the old form.
Jason