This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unroll fixes
- To: mark at codesourcery dot com (Mark Mitchell)
- Subject: Re: Loop unroll fixes
- From: Zoltan Hidvegi <hzoli at hzoli dot 2y dot net>
- Date: Thu, 25 Oct 2001 09:28:48 -0500 (CDT)
- Cc: hzoli at hzoli dot 2y dot net, wilson at cygnus dot com, gcc-patches at gcc dot gnu dot org,bernds at redhat dot com, Franz dot Sirl-kernel at lauterbach dot com
> You're saying that GCC has a long-standing bug whereby some infinite
Earlier yoday, I showed a testcase for that infinite loop, but that
was using ints. The same example can be converted to unsigned ints,
when gcc-2.95.x no longer fails, but gcc-3.0 and later still does.
gcc-2.95.x only used the ctr if it was an increment by 1 loop with
signed loop variable. The unsigned example is shown below.
Zoli
void abort(void);
unsigned int
infinite(unsigned int c)
{
unsigned int i;
unsigned int ct = 0;
for (i = 3; i >= c; i--)
ct++;
return ct;
}
int
main(void)
{
if (infinite(0))
abort();
return 0;
}