Hi, this patch fixes testsuite PR80220 - "relative line numbers don't work when put between braces". Consider gcc/testsuite/gcc.dg/990506-0.c, which has absolute line numbers between braces: ... $ cat -n 990506-0.c 1 /* Verify that a diagnostic is issued without crashing due to 2 --enable-checking catching a bug in the C front end. */ 3 /* { dg-do compile } */ 4 x() 5 { 6 foo (i); 7 /* { dg-error "undeclared" "undeclared-variable message" { target *-*-* } { 6 } } */ 8 /* { dg-message "function it appears in" "reminder message" { target *-*-* } { 6 } } */ 9 } ... When we rewrite the test to use relative line numbers: ... diff --git a/gcc/testsuite/gcc.dg/990506-0.c b/gcc/testsuite/gcc.dg/990506-0.c index 3cd3be3..08ba856 100644 --- a/gcc/testsuite/gcc.dg/990506-0.c +++ b/gcc/testsuite/gcc.dg/990506-0.c @@ -4,6 +4,6 @@ x() { foo (i); - /* { dg-error "undeclared" "undeclared-variable message" { target *-*-* } { 6 } } */ - /* { dg-message "function it appears in" "reminder message" { target *-*-* } { 6 } } */ + /* { dg-error "undeclared" "undeclared-variable message" { target *-*-* } { .-1 } } */ + /* { dg-message "function it appears in" "reminder message" { target *-*-* } { .-2 } } */ } ... we run into trouble: ... ERROR: gcc.dg/990506-0.c: expected integer but got " .-1 " for " dg-error 7 "undeclared" "undeclared-variable message" { target *-*-* } { .-1 } " ... The problem is that the relative line number is written between braces, which results in whitespace before and after the number, and the relative line number handling in process-message doesn't handle that whitespace well. This patch fixes that. Bootstrapped and reg-tested on x86_64. OK for stage4 or stage1 trunk? Thanks, - Tom