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

Tested on AArch64 using the test case provided by the bug
reporter:

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

Without the fix, this program failed to compile:

test.c: In function ‘fun’:
test.c:5:14: error: ‘continue’ statement operand ‘main’
does not refer to a named loop
    5 |     continue main;
      |              ^~~~
test.c:3:3: warning: label ‘main’ defined but not used
\[-Wunused-label\]
    3 |   main:
      |   ^~~~

gcc/xgcc -B gcc -std=gnu2y -O1 -ggdb2 -Wall -c \
  test.c -o test.o

Christopher Bazley (1):
  Fix BZ 119317: named loops (C2y) with debug info

 gcc/c/c-decl.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.43.0

Reply via email to