I would have expected 1997 compilers to already do these standard muliplication
optimizations.
To be fair Linux runs on a lot of CPUs which are not quite as fast
at multiplying as an Opteron, especially not for 64bit multiplies.
So some optimizations might be still a good idea. For divisions
at least Linux also actively does this.
On the other hand compilers also get worse. Modern gccs now turn
while (nsec >= NANOSEC) {
nsec -= NANOSEC;
sec++;
}
into a division which is actually much slower. Or insert unnecessary
cache misses randomly. See the recent gcc thread safety discussion
where it turned out that the thread breaking optimization is actually
more a general pessimization.
-Andi
-