public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat
@ 2003-03-21  1:51 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-03-21  1:51 UTC (permalink / raw)
  To: ernstberg, gcc-bugs, gcc-prs, nobody

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat
@ 2003-03-21 15:04 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-03-21 15:04 UTC (permalink / raw)
  To: ernstberg, gcc-bugs, gcc-prs, nobody

Synopsis: Broken nested Do loop: simple example. gcc 3.2 redhat

State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Fri Mar 21 15:04:15 2003
State-Changed-Why:
    Mistaken

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10176


^ permalink raw reply	[flat|nested] 3+ messages in thread

* c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat
@ 2003-03-21  1:16 ernstberg
  0 siblings, 0 replies; 3+ messages in thread
From: ernstberg @ 2003-03-21  1:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10176
>Category:       c
>Synopsis:       Broken nested Do loop: simple example. gcc 3.2 redhat
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 21 01:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     ernstberg@bigvallet.net
>Release:        gcc 3.2
>Organization:
>Environment:
Redhat Linux 8.0
amd athlon 2400 dual cpu msi motherboard k7d master L
>Description:

 I am a hobby programmer and if I am missing some point forgive me:

 Simple nested do loops. One version with a set of values works.
 Change the values for a second version and the outer loop fails to execute.
Working values are if( x % 2 ){ x *= 3; x += 3;} else x /= 2;
 Broken values are if( x % 3 ){ x *= 4; x += 2;} else x /= 3;

Working program is 3x.c
Broken program is 4x.c
>How-To-Repeat:

 Compile and run.
>Fix:

 I don't know but I have seen the nested do loop broken in a ported C program that worked okay under Amiga's Sas C as well.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gzip; name="Broken_Do.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Broken_Do.tar.gz"

H4sICC9jej4AA0Jyb2tlbl9Eby50YXIA7VhLb+M2EPbV+hXTAIvGtWPrFSdZw0W3aYHmUhRNj73Q
EmUTK5ECSfnRRf57Zyh5/egj7SEbBOB3sC3NgzOfyfksJ9tx1nthhFEYTqdpL0TcnL0j4jCKengj
mabTKI5j8k+vb3oQvnRhhMZYpgF6P2op+L/4PWd/o5hMINkOE2Cm5pkFVYBdcUgmMRSNzKxQEhY7
wOaNhe+5XkKYXEV3V2EStJERet6rsmT2j0MEZcT7PysLklU8P1goilOyBeb6biGWa1aWfDeW3AZC
WqiYkJdrJfJB8CnoN9KIpcR4Z8pUg29zCEfgPo6gXsMIipItR1AqVZNtFkAHipF8UwrJ0RDNcOVs
xeSSY4fCgFUQQqE0SEVuQH7jk+B6rbRoV5zBUTQF4kvtjMQWvvMl1wYil7BmW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threads:[~2003-03-21 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21  1:51 c/10176: Broken nested Do loop: simple example. gcc 3.2 redhat bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-03-21 15:04 bangerth
2003-03-21  1:16 ernstberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).