c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat
bangerth@dealii.org
bangerth@dealii.org
Fri Mar 21 05:40:00 GMT 2003
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
More information about the Gcc-bugs
mailing list