This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mktime.c fixes (part 4 of 6): verify assumptions at compile-time
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~