https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119317

            Bug ID: 119317
           Summary: Named loops (C2y) do not compile with -O1 and -ggdb2
                    or higher
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gandalf at winds dot org
  Target Milestone: ---

Created attachment 60782
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60782&action=edit
gcc output

The following function fails to compile with -O1 and -ggdb2 or higher:

int fun()
{
  main:
  while(1)
    continue main;
}

$ gcc-15 -std=gnu2y -O1 -ggdb2 -Wall -c -o test17.o test17.c
test17.c: In function 'fun':
test17.c:5:14: error: 'continue' statement operand 'main' does not refer to a
named loop
test17.c:3:3: warning: label 'main' defined but not used

Reply via email to