http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49779

           Summary: Wrong code generated for while loop with guard
                    containing continue
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bagn...@cs.unipr.it


GCC turns a program that should loop forever into one that terminates:

$ cat q.c
int main() {
  do {
    while (({ continue; 1; })) {
      return 1;
    }
  } while (0);
  return 0;
}
$ gcc q.c
$ a.out && echo yes
yes

Apparently, GCC erroneously associates the `continue' to the outer `do' loop.

Reply via email to