This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat
- From: bangerth at dealii dot org
- To: ernstberg at bigvalley dot net, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 21 Mar 2003 01:51:28 -0000
- Subject: Re: c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat
- Reply-to: bangerth at dealii dot org, ernstberg at bigvalley dot net, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: Broken nested Do loop: simple example. gcc 3.2 redhat
State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Fri Mar 21 01:51:28 2003
State-Changed-Why:
Your program 4x.c is essentially equivalent to this one:
--------------------------
int main(void)
{
unsigned int count = 1;
do {
if( count % 3 ) { count *= 4; count += 2; }
else { count /= 3; }
if( count == 1 ) break;
if( count == 3 ) break;
} while(1);
return(0);
}
----------------------
What happens is that you never jump out of the inner loop.
Unfortunately, I don't see right away why the loop should
terminate at all. gcc seems to have the same problem, as
does icc. Can you give a simple argument why it should?
Thanks
Wolfgang
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10176