From: Martin Liska Date: Tue, 22 Mar 2022 12:25:57 +0000 (+0100) Subject: aarch64: update error message format. X-Git-Tag: basepoints/gcc-13~555 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6e75a4a353fe36920bac34b66fca4bfb71f7d91;p=thirdparty%2Fgcc.git aarch64: update error message format. Use 'qs' and remove usage '(%qs)'. PR target/104898 gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_handle_attr_arch): Use 'qs' and remove usage '(%qs)'. (aarch64_handle_attr_cpu): Likewise. (aarch64_handle_attr_tune): Likewise. (aarch64_handle_attr_isa_flags): Likewise. gcc/testsuite/ChangeLog: * gcc.target/aarch64/branch-protection-attr.c: Use 'qs' and remove usage '(%qs)'. * gcc.target/aarch64/spellcheck_1.c: Likewise. * gcc.target/aarch64/spellcheck_2.c: Likewise. * gcc.target/aarch64/spellcheck_3.c: Likewise. --- diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 903c842d65a9..2f559600cff5 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18423,11 +18423,11 @@ aarch64_handle_attr_arch (const char *str) error ("missing name in % pragma or attribute"); break; case AARCH64_PARSE_INVALID_ARG: - error ("invalid name (%qs) in % pragma or attribute", str); + error ("invalid name %qs in % pragma or attribute", str); aarch64_print_hint_for_arch (str); break; case AARCH64_PARSE_INVALID_FEATURE: - error ("invalid feature modifier %s of value (%qs) in " + error ("invalid feature modifier %s of value %qs in " "% pragma or attribute", invalid_extension.c_str (), str); aarch64_print_hint_for_extensions (invalid_extension); break; @@ -18465,11 +18465,11 @@ aarch64_handle_attr_cpu (const char *str) error ("missing name in % pragma or attribute"); break; case AARCH64_PARSE_INVALID_ARG: - error ("invalid name (%qs) in % pragma or attribute", str); + error ("invalid name %qs in % pragma or attribute", str); aarch64_print_hint_for_core (str); break; case AARCH64_PARSE_INVALID_FEATURE: - error ("invalid feature modifier %s of value (%qs) in " + error ("invalid feature modifier %qs of value %qs in " "% pragma or attribute", invalid_extension.c_str (), str); aarch64_print_hint_for_extensions (invalid_extension); break; @@ -18496,7 +18496,7 @@ aarch64_handle_attr_cpu (const char *str) " attribute"); break; case AARCH64_PARSE_INVALID_ARG: - error ("invalid protection type (%qs) in % pragma or attribute", err_str); break; case AARCH64_PARSE_OK: @@ -18531,7 +18531,7 @@ aarch64_handle_attr_tune (const char *str) switch (parse_res) { case AARCH64_PARSE_INVALID_ARG: - error ("invalid name (%qs) in % pragma or attribute", str); + error ("invalid name %qs in % pragma or attribute", str); aarch64_print_hint_for_core (str); break; default: @@ -18576,7 +18576,7 @@ aarch64_handle_attr_isa_flags (char *str) break; case AARCH64_PARSE_INVALID_FEATURE: - error ("invalid feature modifier %s of value (%qs) in " + error ("invalid feature modifier %qs of value %qs in " "% pragma or attribute", invalid_extension.c_str (), str); break; diff --git a/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c b/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c index 1d6e55f3907b..272000c27474 100644 --- a/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c +++ b/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c @@ -4,7 +4,7 @@ void __attribute__ ((target("branch-protection=leaf"))) foo1 () { } -/* { dg-error {invalid protection type \('leaf'\) in 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 5 } */ +/* { dg-error {invalid protection type 'leaf' in 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 5 } */ /* { dg-error {pragma or attribute 'target\("branch-protection=leaf"\)' is not valid} "" { target *-*-* } 5 } */ void __attribute__ ((target("branch-protection=none+pac-ret"))) diff --git a/gcc/testsuite/gcc.target/aarch64/spellcheck_1.c b/gcc/testsuite/gcc.target/aarch64/spellcheck_1.c index 8654674fc675..7f58be04bb1f 100644 --- a/gcc/testsuite/gcc.target/aarch64/spellcheck_1.c +++ b/gcc/testsuite/gcc.target/aarch64/spellcheck_1.c @@ -4,6 +4,6 @@ __attribute__((target ("arch=armv8-a-typo"))) void foo () { /* { dg-message "valid arguments are: \[^\n\r]*(; did you mean 'armv*'?)?" "" { target *-*-* } .-1 } */ - /* { dg-error "invalid name \\('armv8-a-typo'\\) in 'target\\(\"arch=\"\\)' pragma or attribute" "" { target *-*-* } .-2 } */ + /* { dg-error "invalid name 'armv8-a-typo' in 'target\\(\"arch=\"\\)' pragma or attribute" "" { target *-*-* } .-2 } */ /* { dg-error "pragma or attribute 'target\\(\"arch=armv8-a-typo\"\\)' is not valid" "" { target *-*-* } .-3 } */ } diff --git a/gcc/testsuite/gcc.target/aarch64/spellcheck_2.c b/gcc/testsuite/gcc.target/aarch64/spellcheck_2.c index 1cc2c0591dc6..83c8686c9227 100644 --- a/gcc/testsuite/gcc.target/aarch64/spellcheck_2.c +++ b/gcc/testsuite/gcc.target/aarch64/spellcheck_2.c @@ -4,6 +4,6 @@ __attribute__((target ("cpu=cortex-a57-typo"))) void foo () { /* { dg-message "valid arguments are: \[^\n\r]*; did you mean 'cortex-a57'?" "" { target *-*-* } .-1 } */ - /* { dg-error "invalid name \\('cortex-a57-typo'\\) in 'target\\(\"cpu=\"\\)' pragma or attribute" "" { target *-*-* } .-2 } */ + /* { dg-error "invalid name 'cortex-a57-typo' in 'target\\(\"cpu=\"\\)' pragma or attribute" "" { target *-*-* } .-2 } */ /* { dg-error "pragma or attribute 'target\\(\"cpu=cortex-a57-typo\"\\)' is not valid" "" { target *-*-* } .-3 } */ } diff --git a/gcc/testsuite/gcc.target/aarch64/spellcheck_3.c b/gcc/testsuite/gcc.target/aarch64/spellcheck_3.c index 9953872b679c..069c4211e481 100644 --- a/gcc/testsuite/gcc.target/aarch64/spellcheck_3.c +++ b/gcc/testsuite/gcc.target/aarch64/spellcheck_3.c @@ -4,6 +4,6 @@ __attribute__((target ("tune=cortex-a57-typo"))) void foo () { /* { dg-message "valid arguments are: \[^\n\r]*; did you mean 'cortex-a57'?" "" { target *-*-* } .-1 } */ - /* { dg-error "invalid name \\('cortex-a57-typo'\\) in 'target\\(\"tune=\"\\)' pragma or attribute" "" { target *-*-* } .-2 } */ + /* { dg-error "invalid name 'cortex-a57-typo' in 'target\\(\"tune=\"\\)' pragma or attribute" "" { target *-*-* } .-2 } */ /* { dg-error "pragma or attribute 'target\\(\"tune=cortex-a57-typo\"\\)' is not valid" "" { target *-*-* } .-3 } */ }