Have you tried to compile, profile and then recompile with the profile info fed
back to the compiler ? I think such a 3-step process is what Philipp Rumpf
had in mind when he said:
I think a lot of the goto's could be removed as soon as there is a decent
possibility to tell the compiler to optimize for a certain case. This was
discussed on the egcs lists some time ago IIRC.
> compare against a final value because on most/many/(all?) processors
> the flags change automatically when decrementing to zero or decrementing
> to a negative number.
MIPS and Alpha don't have `flags'. But I still agree that it's most of the
time cheaper to check against 0 than against any other value.
> while(i--)
> ;
> However, gcc will usually mess with this and end up decrementing a
> value on the stack or in the register-variable case, add extra code.
I believe the problem of stack allocating such loop variables is fairly
specific to register-starved machines such as the i386. And the `extra code'
is also fairly architecture dependent.
Stefan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/