This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Loop overflow
- To: egcs at cygnus dot com
- Subject: Loop overflow
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Tue, 27 Oct 1998 15:02:30 +1300 (NZDT)
Can anyone tell me how many iterations this loop should perform on a
32 bit machine? I cannot find my copy of the C standard and am
wondering if this is allowed to be implementation specific due to
possible overflow. loop_iterations considers this to be an immediate
loop which I don't think is correct.
int
f()
{
int j = 1;
long i;
for (i = 0x7ffffff0L; i <= 0x7fffffffL; i += 1) j++;
return j;
}
Michael.