mktime.c fixes (part 4 of 6): verify assumptions at compile-time

Richard Henderson rth@twiddle.net
Wed Dec 31 23:45:00 GMT 2003


On Wed, Dec 31, 2003 at 03:27:49PM -0800, Paul Eggert wrote:
> Conversely, I don't expect that they have improved
> performance all that much in real code, as not too many people write
> "(2 * a) / 2", even after macro expansion.

Of more importance is knowing that

  int i, n = ...;
  for (i = 0; i < n; ++i)
    ...

iterates no more than INT_MAX times -- i.e. being able to discount n < 0.
This is relevant to making use of decrement-and-branch instructions that
operate on signed counters.


r~



More information about the Libc-alpha mailing list