fix more -Wformat-diag issues

Message ID d3b741eb-29ff-2e45-3baf-d4ff7b247929@gmail.com
State New
Headers show
Series
  • fix more -Wformat-diag issues
Related show

Commit Message

Martin Sebor May 22, 2019, 4:34 p.m.
Incorporating the feedback I got on the -Wformat-diag checker
provided an opportunity to tighten up existing and implement
a small number of few additional rules based on GCC Coding
Conventions (https://gcc.gnu.org/codingconventions.html).
The checker now also warns for incorrect uses of the following:

  *  bitfield (rather than bit-field)
  *  builtin (rather than built-in)
  *  command line (rather than command-line)
  *  enumeral (rather than enumerated)
  *  floating point (rather than floating-point)
  *  non-zero (rather than nonzero)

In addition, it has become better at finding unquoted qualifiers
(like const in const-qualified or "const %qT" rather than %<const
%T%>"), and detects some additional abbreviations (e.g., "stmt"
instead of "statement").

These improvements exposed a number of additional issues in our
sources that the attached patch corrects.

As before, I have tested the patch on x86_64-linux and adjusted
the fallout in the test suite.  More cleanup will likely be needed
on other targets but based on the prior changes I don't expect it
to be extensive.

I will post the patch with the checker implementation separately.

Martin

PS As discussed in the thread below, some of the instances of
added hyphenation in "floating-point" aren't strictly necessary
and the  wording might need to be tweaked a bit to make it so:
   https://gcc.gnu.org/ml/gcc/2019-05/msg00168.html
I'll handle it in a subsequent commit if it's viewed important.

Comments

Jeff Law May 30, 2019, 11:49 p.m. | #1
On 5/22/19 10:34 AM, Martin Sebor wrote:
> Incorporating the feedback I got on the -Wformat-diag checker

> provided an opportunity to tighten up existing and implement

> a small number of few additional rules based on GCC Coding

> Conventions (https://gcc.gnu.org/codingconventions.html).

> The checker now also warns for incorrect uses of the following:

> 

>  *  bitfield (rather than bit-field)

>  *  builtin (rather than built-in)

>  *  command line (rather than command-line)

>  *  enumeral (rather than enumerated)

>  *  floating point (rather than floating-point)

>  *  non-zero (rather than nonzero)

> 

> In addition, it has become better at finding unquoted qualifiers

> (like const in const-qualified or "const %qT" rather than %<const

> %T%>"), and detects some additional abbreviations (e.g., "stmt"

> instead of "statement").

> 

> These improvements exposed a number of additional issues in our

> sources that the attached patch corrects.

> 

> As before, I have tested the patch on x86_64-linux and adjusted

> the fallout in the test suite.  More cleanup will likely be needed

> on other targets but based on the prior changes I don't expect it

> to be extensive.

> 

> I will post the patch with the checker implementation separately.

> 

> Martin

> 

> PS As discussed in the thread below, some of the instances of

> added hyphenation in "floating-point" aren't strictly necessary

> and the  wording might need to be tweaked a bit to make it so:

>   https://gcc.gnu.org/ml/gcc/2019-05/msg00168.html

> I'll handle it in a subsequent commit if it's viewed important.

> 

> gcc-wformat-diag.diff

> 

> gcc/c/ChangeLog:

> 

> 	* c-decl.c (start_decl): Adjust quoting and hyphenation

> 	in diagnostics.

> 	(finish_decl): Same.

> 	(finish_enum): Same.

> 	(start_function): Same.

> 	(declspecs_add_type): Same.

> 	* c-parser.c (warn_for_abs): Same.

> 	* c-typeck.c (build_binary_op): Same.

> 

> gcc/c-family/ChangeLog:

> 

> 	* c-attribs.c (handle_mode_attribute): Adjust quoting and hyphenation.

> 	(handle_alias_ifunc_attribute): Same.

> 	(handle_copy_attribute): Same.

> 	(handle_weakref_attribute): Same.

> 	(handle_nonnull_attribute): Same.

> 	* c-warn.c (warn_for_sign_compare): Same.

> 	(warn_for_restrict): Same.

> 	* c.opt: Same.

> 

> 	* c-common.h (GCC_DIAG_STYLE): Adjust.

> 	 (GCC_DIAG_RAW_STYLE): New macro.

> 

> gcc/cp/ChangeLog:

> 

> 	* call.c (build_conditional_expr_1): Adjust quoting and hyphenation.

> 	(convert_like_real): Same.

> 	(convert_arg_to_ellipsis): Same.

> 	* constexpr.c (diag_array_subscript): Same.

> 	* constraint.cc (diagnose_trait_expression): Same.

> 	* cvt.c (ocp_convert): Same.

> 	* decl.c (start_decl): Same.

> 	(check_for_uninitialized_const_var): Same.

> 	(grokfndecl): Same.

> 	(check_special_function_return_type): Same.

> 	(finish_enum_value_list): Same.

> 	(start_preparsed_function): Same.

> 	* parser.c (cp_parser_decl_specifier_seq): Same.

> 	* typeck.c (cp_build_binary_op): Same.

> 	(build_static_cast_1): Same.

> 

> 	* cp-tree.h (GCC_DIAG_STYLE): Adjust.

> 	 (GCC_DIAG_RAW_STYLE): New macro.

> 

> gcc/lto/ChangeLog:

> 

> 	* lto-common.c (lto_file_finalize): Adjust quoting and hyphenation.

> 

> gcc/objc/ChangeLog:

> 

> 	* objc-act.c (objc_build_setter_call): Adjust quoting and hyphenation.

> 	* objc-encoding.c (encode_gnu_bitfield): Same.

> 

> gcc/ChangeLog:

> 

> 	* config/i386/i386-features.c (ix86_get_function_versions_dispatcher):

> 	Adjust quoting and hyphenation.

> 	* convert.c (convert_to_real_1): Same.

> 	* gcc.c (driver_wrong_lang_callback): Same.

> 	(driver::handle_unrecognized_options): Same.

> 	* gimple-ssa-nonnull-compare.c (do_warn_nonnull_compare): Same.

> 	* opts-common.c (cmdline_handle_error): Same.

> 	(read_cmdline_option): Same.

> 	* opts-global.c (complain_wrong_lang): Same.

> 	(print_ignored_options): Same.

> 	(handle_common_deferred_options): Same.

> 	* pretty-print.h: Same.

> 	* print-rtl.c (debug_bb_n_slim): Same.

> 	* sched-rgn.c (make_pass_sched_fusion): Same.

> 	* tree-cfg.c (verify_gimple_assign_unary): Same.

> 	(verify_gimple_label): Same.

> 	* tree-ssa-operands.c (verify_ssa_operands): Same.

> 	* varasm.c (do_assemble_alias): Same.

> 	(assemble_alias): Same.

> 

> 	* diagnostic-core.h (GCC_DIAG_STYLE): Adjust.

> 	 (GCC_DIAG_RAW_STYLE): New macro.

> 

> 	* cfghooks.c: Disable -Wformat-diags.

> 	* cfgloop.c: Same.

> 	* cfgrtl.c: Same.

> 	* cgraph.c: Same.

> 	* diagnostic-show-locus.c: Same.

> 	* diagnostic.c: Same.

> 	* gimple-pretty-print.c: Same.

> 	* graph.c: Same.

> 	* symtab.c: Same.

> 	* tree-eh.c Same.

> 	* tree-pretty-print.c: Same.

> 	* tree-ssa.c: Same.

> 

> 	* configure: Regenerate.

> 	* configure.ac (ACX_PROG_CXX_WARNING_OPTS): Add -Wno-error=format-diag.

> 	 (ACX_PROG_CC_WARNING_OPTS): Same.

So in several places there's a comment which indicates that debugging
dumps and the like do not follow conventions.  Presumably you've tried
to keep a narrow scope on the diagnostic push/pops.  I'm also concerned
that the comments you mention that we trigger an ICE.

So while I'll ack this patch, I would like to know more about the ICE
that's triggered in the checker and what the plans are for fixing it.


Jeff
Martin Sebor May 31, 2019, 3:56 p.m. | #2
On 5/30/19 5:49 PM, Jeff Law wrote:
> On 5/22/19 10:34 AM, Martin Sebor wrote:

>> Incorporating the feedback I got on the -Wformat-diag checker

>> provided an opportunity to tighten up existing and implement

>> a small number of few additional rules based on GCC Coding

>> Conventions (https://gcc.gnu.org/codingconventions.html).

>> The checker now also warns for incorrect uses of the following:

>>

>>   *  bitfield (rather than bit-field)

>>   *  builtin (rather than built-in)

>>   *  command line (rather than command-line)

>>   *  enumeral (rather than enumerated)

>>   *  floating point (rather than floating-point)

>>   *  non-zero (rather than nonzero)

>>

>> In addition, it has become better at finding unquoted qualifiers

>> (like const in const-qualified or "const %qT" rather than %<const

>> %T%>"), and detects some additional abbreviations (e.g., "stmt"

>> instead of "statement").

>>

>> These improvements exposed a number of additional issues in our

>> sources that the attached patch corrects.

>>

>> As before, I have tested the patch on x86_64-linux and adjusted

>> the fallout in the test suite.  More cleanup will likely be needed

>> on other targets but based on the prior changes I don't expect it

>> to be extensive.

>>

>> I will post the patch with the checker implementation separately.

>>

>> Martin

>>

>> PS As discussed in the thread below, some of the instances of

>> added hyphenation in "floating-point" aren't strictly necessary

>> and the  wording might need to be tweaked a bit to make it so:

>>    https://gcc.gnu.org/ml/gcc/2019-05/msg00168.html

>> I'll handle it in a subsequent commit if it's viewed important.

>>

>> gcc-wformat-diag.diff

>>

>> gcc/c/ChangeLog:

>>

>> 	* c-decl.c (start_decl): Adjust quoting and hyphenation

>> 	in diagnostics.

>> 	(finish_decl): Same.

>> 	(finish_enum): Same.

>> 	(start_function): Same.

>> 	(declspecs_add_type): Same.

>> 	* c-parser.c (warn_for_abs): Same.

>> 	* c-typeck.c (build_binary_op): Same.

>>

>> gcc/c-family/ChangeLog:

>>

>> 	* c-attribs.c (handle_mode_attribute): Adjust quoting and hyphenation.

>> 	(handle_alias_ifunc_attribute): Same.

>> 	(handle_copy_attribute): Same.

>> 	(handle_weakref_attribute): Same.

>> 	(handle_nonnull_attribute): Same.

>> 	* c-warn.c (warn_for_sign_compare): Same.

>> 	(warn_for_restrict): Same.

>> 	* c.opt: Same.

>>

>> 	* c-common.h (GCC_DIAG_STYLE): Adjust.

>> 	 (GCC_DIAG_RAW_STYLE): New macro.

>>

>> gcc/cp/ChangeLog:

>>

>> 	* call.c (build_conditional_expr_1): Adjust quoting and hyphenation.

>> 	(convert_like_real): Same.

>> 	(convert_arg_to_ellipsis): Same.

>> 	* constexpr.c (diag_array_subscript): Same.

>> 	* constraint.cc (diagnose_trait_expression): Same.

>> 	* cvt.c (ocp_convert): Same.

>> 	* decl.c (start_decl): Same.

>> 	(check_for_uninitialized_const_var): Same.

>> 	(grokfndecl): Same.

>> 	(check_special_function_return_type): Same.

>> 	(finish_enum_value_list): Same.

>> 	(start_preparsed_function): Same.

>> 	* parser.c (cp_parser_decl_specifier_seq): Same.

>> 	* typeck.c (cp_build_binary_op): Same.

>> 	(build_static_cast_1): Same.

>>

>> 	* cp-tree.h (GCC_DIAG_STYLE): Adjust.

>> 	 (GCC_DIAG_RAW_STYLE): New macro.

>>

>> gcc/lto/ChangeLog:

>>

>> 	* lto-common.c (lto_file_finalize): Adjust quoting and hyphenation.

>>

>> gcc/objc/ChangeLog:

>>

>> 	* objc-act.c (objc_build_setter_call): Adjust quoting and hyphenation.

>> 	* objc-encoding.c (encode_gnu_bitfield): Same.

>>

>> gcc/ChangeLog:

>>

>> 	* config/i386/i386-features.c (ix86_get_function_versions_dispatcher):

>> 	Adjust quoting and hyphenation.

>> 	* convert.c (convert_to_real_1): Same.

>> 	* gcc.c (driver_wrong_lang_callback): Same.

>> 	(driver::handle_unrecognized_options): Same.

>> 	* gimple-ssa-nonnull-compare.c (do_warn_nonnull_compare): Same.

>> 	* opts-common.c (cmdline_handle_error): Same.

>> 	(read_cmdline_option): Same.

>> 	* opts-global.c (complain_wrong_lang): Same.

>> 	(print_ignored_options): Same.

>> 	(handle_common_deferred_options): Same.

>> 	* pretty-print.h: Same.

>> 	* print-rtl.c (debug_bb_n_slim): Same.

>> 	* sched-rgn.c (make_pass_sched_fusion): Same.

>> 	* tree-cfg.c (verify_gimple_assign_unary): Same.

>> 	(verify_gimple_label): Same.

>> 	* tree-ssa-operands.c (verify_ssa_operands): Same.

>> 	* varasm.c (do_assemble_alias): Same.

>> 	(assemble_alias): Same.

>>

>> 	* diagnostic-core.h (GCC_DIAG_STYLE): Adjust.

>> 	 (GCC_DIAG_RAW_STYLE): New macro.

>>

>> 	* cfghooks.c: Disable -Wformat-diags.

>> 	* cfgloop.c: Same.

>> 	* cfgrtl.c: Same.

>> 	* cgraph.c: Same.

>> 	* diagnostic-show-locus.c: Same.

>> 	* diagnostic.c: Same.

>> 	* gimple-pretty-print.c: Same.

>> 	* graph.c: Same.

>> 	* symtab.c: Same.

>> 	* tree-eh.c Same.

>> 	* tree-pretty-print.c: Same.

>> 	* tree-ssa.c: Same.

>>

>> 	* configure: Regenerate.

>> 	* configure.ac (ACX_PROG_CXX_WARNING_OPTS): Add -Wno-error=format-diag.

>> 	 (ACX_PROG_CC_WARNING_OPTS): Same.

> So in several places there's a comment which indicates that debugging

> dumps and the like do not follow conventions.  Presumably you've tried

> to keep a narrow scope on the diagnostic push/pops.  I'm also concerned

> that the comments you mention that we trigger an ICE.

> 

> So while I'll ack this patch, I would like to know more about the ICE

> that's triggered in the checker and what the plans are for fixing it.


Sorry, I didn't word the comment (copied below) very clearly.
What I meant to say is that the calls to error() in these files
that don't follow the convention are ultimately followed by
an ICE triggered either by an assert (as in cfgloop.c) or a call
to internal_error (cgraph.h).  The diagnostics themselves don't
cause an ICE.

In a comment on one of the i18n bugs raised for these strings
Richard suggests these error calls should probably replaced by
direct calls to the pretty printer.  That would let us avoid
suppressing the warnings and also presumably make it clear to
translators the format strings aren't meant to be translated.
It seemed like too big of a change for this patch so I simply
suppressed the warnings but I agree it's worth considering at
some point.

I'll adjust the comment before I check in the patch (I'm hoping
to commit it at the same time as the checker itself once it's
approved).

+/* Disable warnings about missing quoting in GCC diagnostics for
+   the verification errors.  Their format strings don't follow
+   GCC diagnostic conventions and trigger an ICE in the end.  */
+#if __GNUC__ >= 10
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+

Martin
Jeff Law May 31, 2019, 6:20 p.m. | #3
On 5/31/19 9:56 AM, Martin Sebor wrote:
> On 5/30/19 5:49 PM, Jeff Law wrote:

>> So in several places there's a comment which indicates that debugging

>> dumps and the like do not follow conventions.  Presumably you've tried

>> to keep a narrow scope on the diagnostic push/pops.  I'm also concerned

>> that the comments you mention that we trigger an ICE.

>>

>> So while I'll ack this patch, I would like to know more about the ICE

>> that's triggered in the checker and what the plans are for fixing it.

> 

> Sorry, I didn't word the comment (copied below) very clearly.

> What I meant to say is that the calls to error() in these files

> that don't follow the convention are ultimately followed by

> an ICE triggered either by an assert (as in cfgloop.c) or a call

> to internal_error (cgraph.h).  The diagnostics themselves don't

> cause an ICE.

OK.  Thanks for the clarification.

> 

> In a comment on one of the i18n bugs raised for these strings

> Richard suggests these error calls should probably replaced by

> direct calls to the pretty printer.  That would let us avoid

> suppressing the warnings and also presumably make it clear to

> translators the format strings aren't meant to be translated.

> It seemed like too big of a change for this patch so I simply

> suppressed the warnings but I agree it's worth considering at

> some point.

Agreed.

> 

> I'll adjust the comment before I check in the patch (I'm hoping

> to commit it at the same time as the checker itself once it's

> approved).

Your call on when to commit :-)

Jeff
Martin Sebor June 5, 2019, 6:33 p.m. | #4
On 5/31/19 12:20 PM, Jeff Law wrote:
> On 5/31/19 9:56 AM, Martin Sebor wrote:

>> On 5/30/19 5:49 PM, Jeff Law wrote:

>>> So in several places there's a comment which indicates that debugging

>>> dumps and the like do not follow conventions.  Presumably you've tried

>>> to keep a narrow scope on the diagnostic push/pops.  I'm also concerned

>>> that the comments you mention that we trigger an ICE.

>>>

>>> So while I'll ack this patch, I would like to know more about the ICE

>>> that's triggered in the checker and what the plans are for fixing it.

>>

>> Sorry, I didn't word the comment (copied below) very clearly.

>> What I meant to say is that the calls to error() in these files

>> that don't follow the convention are ultimately followed by

>> an ICE triggered either by an assert (as in cfgloop.c) or a call

>> to internal_error (cgraph.h).  The diagnostics themselves don't

>> cause an ICE.

> OK.  Thanks for the clarification.

> 

>>

>> In a comment on one of the i18n bugs raised for these strings

>> Richard suggests these error calls should probably replaced by

>> direct calls to the pretty printer.  That would let us avoid

>> suppressing the warnings and also presumably make it clear to

>> translators the format strings aren't meant to be translated.

>> It seemed like too big of a change for this patch so I simply

>> suppressed the warnings but I agree it's worth considering at

>> some point.

> Agreed.

> 

>>

>> I'll adjust the comment before I check in the patch (I'm hoping

>> to commit it at the same time as the checker itself once it's

>> approved).

> Your call on when to commit :-)


I just committed it in r271971 with a few minor tweaks.  As before
I expect some minor fallout in the test suite, and more fixes to
follow once the checker itself is approved and committed.

Martin
Jakub Jelinek June 6, 2019, 9:39 a.m. | #5
On Wed, May 22, 2019 at 10:34:00AM -0600, Martin Sebor wrote:
> gcc/ChangeLog:

> 

> 	* config/i386/i386-features.c (ix86_get_function_versions_dispatcher):

> 	Adjust quoting and hyphenation.

> 	* convert.c (convert_to_real_1): Same.

> 	* gcc.c (driver_wrong_lang_callback): Same.

> 	(driver::handle_unrecognized_options): Same.

> 	* gimple-ssa-nonnull-compare.c (do_warn_nonnull_compare): Same.

> 	* opts-common.c (cmdline_handle_error): Same.

> 	(read_cmdline_option): Same.

> 	* opts-global.c (complain_wrong_lang): Same.

> 	(print_ignored_options): Same.

> 	(handle_common_deferred_options): Same.

> 	* pretty-print.h: Same.

> 	* print-rtl.c (debug_bb_n_slim): Same.

> 	* sched-rgn.c (make_pass_sched_fusion): Same.

> 	* tree-cfg.c (verify_gimple_assign_unary): Same.

> 	(verify_gimple_label): Same.

> 	* tree-ssa-operands.c (verify_ssa_operands): Same.

> 	* varasm.c (do_assemble_alias): Same.

> 	(assemble_alias): Same.

> 

> 	* diagnostic-core.h (GCC_DIAG_STYLE): Adjust.

> 	 (GCC_DIAG_RAW_STYLE): New macro.

> 

> 	* cfghooks.c: Disable -Wformat-diags.

> 	* cfgloop.c: Same.

> 	* cfgrtl.c: Same.

> 	* cgraph.c: Same.

> 	* diagnostic-show-locus.c: Same.

> 	* diagnostic.c: Same.

> 	* gimple-pretty-print.c: Same.

> 	* graph.c: Same.

> 	* symtab.c: Same.

> 	* tree-eh.c Same.

> 	* tree-pretty-print.c: Same.

> 	* tree-ssa.c: Same.

> 

> 	* configure: Regenerate.

> 	* configure.ac (ACX_PROG_CXX_WARNING_OPTS): Add -Wno-error=format-diag.

> 	 (ACX_PROG_CC_WARNING_OPTS): Same.


Changes for the same change shouldn't be separated by empty newlines in the
ChangeLog.  Furthermore, you've managed to commit only the first part (until
varasm.c) and not the rest.

> diff --git a/gcc/configure b/gcc/configure

> index 4a3d5eefcb8..c9062cca9d6 100755

> --- a/gcc/configure

> +++ b/gcc/configure

> @@ -6797,7 +6797,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu

>  

>  c_loose_warn=

>  save_CFLAGS="$CFLAGS"

> -for real_option in -Wstrict-prototypes -Wmissing-prototypes; do

> +for real_option in -Wstrict-prototypes -Wmissing-prototypes-Wno-error=format-diag; do

>    # Do the check with the no- prefix removed since gcc silently

>    # accepts any -Wno-* option on purpose

>    case $real_option in


The above was probably regenerated before you've added a space:

> diff --git a/gcc/configure.ac b/gcc/configure.ac

> index 35982fdc9ed..cbc0c25fa2b 100644

> --- a/gcc/configure.ac

> +++ b/gcc/configure.ac

> @@ -483,10 +483,11 @@ AS_IF([test $enable_build_format_warnings = no],

>        [wf_opt=-Wno-format],[wf_opt=])

>  ACX_PROG_CXX_WARNING_OPTS(

>  	m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],

> -		       [-Wcast-qual $wf_opt])), [loose_warn])

> +		       [-Wcast-qual -Wno-error=format-diag $wf_opt])),

> +		       [loose_warn])

>  ACX_PROG_CC_WARNING_OPTS(

> -	m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),

> -	[c_loose_warn])

> +	m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes ],


                                                                ^--HERE
I've committed following to fix that up as obvious:

2019-06-06  Jakub Jelinek  <jakub@redhat.com>

	* configure: Regenerate.

--- gcc/configure	(revision 271993)
+++ gcc/configure	(revision 271994)
@@ -6797,7 +6797,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 c_loose_warn=
 save_CFLAGS="$CFLAGS"
-for real_option in -Wstrict-prototypes -Wmissing-prototypes-Wno-error=format-diag; do
+for real_option in -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag; do
   # Do the check with the no- prefix removed since gcc silently
   # accepts any -Wno-* option on purpose
   case $real_option in


	Jakub
Martin Sebor June 6, 2019, 2:45 p.m. | #6
On 6/6/19 3:39 AM, Jakub Jelinek wrote:
> On Wed, May 22, 2019 at 10:34:00AM -0600, Martin Sebor wrote:

>> gcc/ChangeLog:

>>

>> 	* config/i386/i386-features.c (ix86_get_function_versions_dispatcher):

>> 	Adjust quoting and hyphenation.

>> 	* convert.c (convert_to_real_1): Same.

>> 	* gcc.c (driver_wrong_lang_callback): Same.

>> 	(driver::handle_unrecognized_options): Same.

>> 	* gimple-ssa-nonnull-compare.c (do_warn_nonnull_compare): Same.

>> 	* opts-common.c (cmdline_handle_error): Same.

>> 	(read_cmdline_option): Same.

>> 	* opts-global.c (complain_wrong_lang): Same.

>> 	(print_ignored_options): Same.

>> 	(handle_common_deferred_options): Same.

>> 	* pretty-print.h: Same.

>> 	* print-rtl.c (debug_bb_n_slim): Same.

>> 	* sched-rgn.c (make_pass_sched_fusion): Same.

>> 	* tree-cfg.c (verify_gimple_assign_unary): Same.

>> 	(verify_gimple_label): Same.

>> 	* tree-ssa-operands.c (verify_ssa_operands): Same.

>> 	* varasm.c (do_assemble_alias): Same.

>> 	(assemble_alias): Same.

>>

>> 	* diagnostic-core.h (GCC_DIAG_STYLE): Adjust.

>> 	 (GCC_DIAG_RAW_STYLE): New macro.

>>

>> 	* cfghooks.c: Disable -Wformat-diags.

>> 	* cfgloop.c: Same.

>> 	* cfgrtl.c: Same.

>> 	* cgraph.c: Same.

>> 	* diagnostic-show-locus.c: Same.

>> 	* diagnostic.c: Same.

>> 	* gimple-pretty-print.c: Same.

>> 	* graph.c: Same.

>> 	* symtab.c: Same.

>> 	* tree-eh.c Same.

>> 	* tree-pretty-print.c: Same.

>> 	* tree-ssa.c: Same.

>>

>> 	* configure: Regenerate.

>> 	* configure.ac (ACX_PROG_CXX_WARNING_OPTS): Add -Wno-error=format-diag.

>> 	 (ACX_PROG_CC_WARNING_OPTS): Same.

> 

> Changes for the same change shouldn't be separated by empty newlines in the

> ChangeLog.  Furthermore, you've managed to commit only the first part (until

> varasm.c) and not the rest.


I actually managed to do that on purpose.  I just didn't "manage"
to also update the ever important ChangeLog.  There are probably
other mistakes in it.

> 

>> diff --git a/gcc/configure b/gcc/configure

>> index 4a3d5eefcb8..c9062cca9d6 100755

>> --- a/gcc/configure

>> +++ b/gcc/configure

>> @@ -6797,7 +6797,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu

>>   

>>   c_loose_warn=

>>   save_CFLAGS="$CFLAGS"

>> -for real_option in -Wstrict-prototypes -Wmissing-prototypes; do

>> +for real_option in -Wstrict-prototypes -Wmissing-prototypes-Wno-error=format-diag; do

>>     # Do the check with the no- prefix removed since gcc silently

>>     # accepts any -Wno-* option on purpose

>>     case $real_option in

> 

> The above was probably regenerated before you've added a space:


Yes.

> 

>> diff --git a/gcc/configure.ac b/gcc/configure.ac

>> index 35982fdc9ed..cbc0c25fa2b 100644

>> --- a/gcc/configure.ac

>> +++ b/gcc/configure.ac

>> @@ -483,10 +483,11 @@ AS_IF([test $enable_build_format_warnings = no],

>>         [wf_opt=-Wno-format],[wf_opt=])

>>   ACX_PROG_CXX_WARNING_OPTS(

>>   	m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],

>> -		       [-Wcast-qual $wf_opt])), [loose_warn])

>> +		       [-Wcast-qual -Wno-error=format-diag $wf_opt])),

>> +		       [loose_warn])

>>   ACX_PROG_CC_WARNING_OPTS(

>> -	m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),

>> -	[c_loose_warn])

>> +	m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes ],

> 

>                                                                  ^--HERE

> I've committed following to fix that up as obvious:


Thank you.

Martin

> 

> 2019-06-06  Jakub Jelinek  <jakub@redhat.com>

> 

> 	* configure: Regenerate.

> 

> --- gcc/configure	(revision 271993)

> +++ gcc/configure	(revision 271994)

> @@ -6797,7 +6797,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu

>   

>   c_loose_warn=

>   save_CFLAGS="$CFLAGS"

> -for real_option in -Wstrict-prototypes -Wmissing-prototypes-Wno-error=format-diag; do

> +for real_option in -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag; do

>     # Do the check with the no- prefix removed since gcc silently

>     # accepts any -Wno-* option on purpose

>     case $real_option in

> 

> 

> 	Jakub

>
Jakub Jelinek June 6, 2019, 3:42 p.m. | #7
On Thu, Jun 06, 2019 at 08:45:56AM -0600, Martin Sebor wrote:
> > Changes for the same change shouldn't be separated by empty newlines in the

> > ChangeLog.  Furthermore, you've managed to commit only the first part (until

> > varasm.c) and not the rest.

> 

> I actually managed to do that on purpose.  I just didn't "manage"

> to also update the ever important ChangeLog.  There are probably

> other mistakes in it.


The coding conventions says not to, so have you violated that on purpose?
https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Style-of-Change-Logs
"Separate unrelated change log entries with blank lines.
Don’t put blank lines between individual changes of an entry."

I don't see any changes in that patch as unrelated, after all, if they were
unrelated, they ought to be committed separately.

	Jakub
Martin Sebor June 6, 2019, 4:11 p.m. | #8
On 6/6/19 9:42 AM, Jakub Jelinek wrote:
> On Thu, Jun 06, 2019 at 08:45:56AM -0600, Martin Sebor wrote:

>>> Changes for the same change shouldn't be separated by empty newlines in the

>>> ChangeLog.  Furthermore, you've managed to commit only the first part (until

>>> varasm.c) and not the rest.

>>

>> I actually managed to do that on purpose.  I just didn't "manage"

>> to also update the ever important ChangeLog.  There are probably

>> other mistakes in it.

> 

> The coding conventions says not to, so have you violated that on purpose?


Are you for real?  Yes, I added a blank line on purpose.

> https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Style-of-Change-Logs

> "Separate unrelated change log entries with blank lines.

> Don’t put blank lines between individual changes of an entry."


It's pretty pathetic that the only thing you choose to say in
response to my change to better align GCC code with the coding
conventions is to chastise me for trying to make the ChangeLog
entry more readable by adding a blank line to it.

> I don't see any changes in that patch as unrelated, after all, if they were

> unrelated, they ought to be committed separately.


Thanks for the lecture.
Christophe Lyon June 7, 2019, 12:57 p.m. | #9
On Wed, 5 Jun 2019 at 20:33, Martin Sebor <msebor@gmail.com> wrote:
>

> On 5/31/19 12:20 PM, Jeff Law wrote:

> > On 5/31/19 9:56 AM, Martin Sebor wrote:

> >> On 5/30/19 5:49 PM, Jeff Law wrote:

> >>> So in several places there's a comment which indicates that debugging

> >>> dumps and the like do not follow conventions.  Presumably you've tried

> >>> to keep a narrow scope on the diagnostic push/pops.  I'm also concerned

> >>> that the comments you mention that we trigger an ICE.

> >>>

> >>> So while I'll ack this patch, I would like to know more about the ICE

> >>> that's triggered in the checker and what the plans are for fixing it.

> >>

> >> Sorry, I didn't word the comment (copied below) very clearly.

> >> What I meant to say is that the calls to error() in these files

> >> that don't follow the convention are ultimately followed by

> >> an ICE triggered either by an assert (as in cfgloop.c) or a call

> >> to internal_error (cgraph.h).  The diagnostics themselves don't

> >> cause an ICE.

> > OK.  Thanks for the clarification.

> >

> >>

> >> In a comment on one of the i18n bugs raised for these strings

> >> Richard suggests these error calls should probably replaced by

> >> direct calls to the pretty printer.  That would let us avoid

> >> suppressing the warnings and also presumably make it clear to

> >> translators the format strings aren't meant to be translated.

> >> It seemed like too big of a change for this patch so I simply

> >> suppressed the warnings but I agree it's worth considering at

> >> some point.

> > Agreed.

> >

> >>

> >> I'll adjust the comment before I check in the patch (I'm hoping

> >> to commit it at the same time as the checker itself once it's

> >> approved).

> > Your call on when to commit :-)

>

> I just committed it in r271971 with a few minor tweaks.  As before

> I expect some minor fallout in the test suite, and more fixes to

> follow once the checker itself is approved and committed.

>


Hi,

I suspect you've already noticed that
FAIL: gcc.dg/format/gcc_diag-11.c

on arm, aarch64 and x86 according to gcc-testresults.

Christophe


> Martin
Martin Sebor June 7, 2019, 2:08 p.m. | #10
On 6/7/19 6:57 AM, Christophe Lyon wrote:
> On Wed, 5 Jun 2019 at 20:33, Martin Sebor <msebor@gmail.com> wrote:

>>

>> On 5/31/19 12:20 PM, Jeff Law wrote:

>>> On 5/31/19 9:56 AM, Martin Sebor wrote:

>>>> On 5/30/19 5:49 PM, Jeff Law wrote:

>>>>> So in several places there's a comment which indicates that debugging

>>>>> dumps and the like do not follow conventions.  Presumably you've tried

>>>>> to keep a narrow scope on the diagnostic push/pops.  I'm also concerned

>>>>> that the comments you mention that we trigger an ICE.

>>>>>

>>>>> So while I'll ack this patch, I would like to know more about the ICE

>>>>> that's triggered in the checker and what the plans are for fixing it.

>>>>

>>>> Sorry, I didn't word the comment (copied below) very clearly.

>>>> What I meant to say is that the calls to error() in these files

>>>> that don't follow the convention are ultimately followed by

>>>> an ICE triggered either by an assert (as in cfgloop.c) or a call

>>>> to internal_error (cgraph.h).  The diagnostics themselves don't

>>>> cause an ICE.

>>> OK.  Thanks for the clarification.

>>>

>>>>

>>>> In a comment on one of the i18n bugs raised for these strings

>>>> Richard suggests these error calls should probably replaced by

>>>> direct calls to the pretty printer.  That would let us avoid

>>>> suppressing the warnings and also presumably make it clear to

>>>> translators the format strings aren't meant to be translated.

>>>> It seemed like too big of a change for this patch so I simply

>>>> suppressed the warnings but I agree it's worth considering at

>>>> some point.

>>> Agreed.

>>>

>>>>

>>>> I'll adjust the comment before I check in the patch (I'm hoping

>>>> to commit it at the same time as the checker itself once it's

>>>> approved).

>>> Your call on when to commit :-)

>>

>> I just committed it in r271971 with a few minor tweaks.  As before

>> I expect some minor fallout in the test suite, and more fixes to

>> follow once the checker itself is approved and committed.

>>

> 

> Hi,

> 

> I suspect you've already noticed that

> FAIL: gcc.dg/format/gcc_diag-11.c

> 

> on arm, aarch64 and x86 according to gcc-testresults.


Yes, it fails everywhere because the warning patch itself hasn't
been approved yet.  I committed the test by accident along with
the cleanup, and I disabled it in r271975.

Martin

> 

> Christophe

> 

> 

>> Martin

Patch

gcc/testsuite/ChangeLog:

	* c-c++-common/nonnull-1.c: Adjust text of expected diagnostic.
	* c-c++-common/nonnull-2.c: Same.
	* c-c++-common/nonnull-3.c: Same.
	* c-c++-common/pr35503-1.c: Same.
	* c-c++-common/pr35503-2.c: Same.
	* c-c++-common/pr35503-3.c: Same.
	* g++.dg/abi/empty12.C: Same.
	* g++.dg/abi/empty13.C: Same.
	* g++.dg/abi/empty14.C: Same.
	* g++.dg/abi/empty15.C: Same.
	* g++.dg/abi/empty16.C: Same.
	* g++.dg/abi/empty17.C: Same.
	* g++.dg/abi/empty18.C: Same.
	* g++.dg/abi/empty19.C: Same.
	* g++.dg/abi/empty22.C: Same.
	* g++.dg/abi/empty25.C: Same.
	* g++.dg/abi/empty26.C: Same.
	* g++.dg/concepts/decl-diagnose.C: Same.
	* g++.dg/conversion/bitfield7.C: Same.
	* g++.dg/cpp0x/addressof2.C: Same.
	* g++.dg/cpp0x/constexpr-condition.C: Same.
	* g++.dg/cpp0x/constexpr-neg1.C: Same.
	* g++.dg/cpp0x/constexpr-object1.C: Same.
	* g++.dg/cpp0x/defaulted2.C: Same.
	* g++.dg/cpp0x/gnu_fext-numeric-literals.C: Same.
	* g++.dg/cpp0x/pr42844-2.C: Same.
	* g++.dg/cpp0x/pr83993.C (foo): Same.
	* g++.dg/cpp0x/std_fext-numeric-literals.C: Same.
	* g++.dg/cpp0x/udlit-shadow-neg.C: Same.
	* g++.dg/cpp1z/inline-var2.C: Same.
	* g++.dg/init/pr42844.C: Same.
	* g++.dg/tree-ssa/pr20280.C: Same.
	* g++.dg/warn/Wfloat-equal-1.C: Same.
	* g++.dg/warn/Wrestrict-1.C: Same.
	* g++.dg/warn/Wrestrict-2.C: Same.
	* g++.dg/warn/nonnull3.C: Same.
	* g++.dg/warn/pr8715.C: Same.
	* g++.old-deja/g++.other/cond5.C: Same.
	* gcc.dg/Wfloat-equal-1.c: Same.
	* gcc.dg/attr-noinline.c: Same.
	* gcc.dg/attr-noipa.c: Same.
	* gcc.dg/attr-weakref-2.c: Same.
	* gcc.dg/cast-1.c (f): Same.
	* gcc.dg/cast-2.c (f): Same.
	* gcc.dg/cast-3.c (f): Same.
	* gcc.dg/dfp/cast-bad.c (f): Same.
	* gcc.dg/dfp/warn-abs-2.c: Same.
	* gcc.dg/enum-mode-1.c: Same.
	* gcc.dg/format/gcc_diag-1.c: Same.
	* gcc.dg/format/gcc_diag-11.c: Same.New test.
	* gcc.dg/funroll-loops-all.c: Same.
	* gcc.dg/misc-column.c: Same.
	* gcc.dg/opts-5.c: Same.
	* gcc.dg/pr28322-2.c: Same.
	* gcc.dg/pr28322-3.c: Same.
	* gcc.dg/pr60087.c (foo): Same.
	* gcc.dg/pr78957.c: Same.
	* gcc.dg/pr8715.c: Same.
	* gcc.dg/simd-2.c (hanneke): Same.
	* gcc.dg/spellcheck-options-1.c: Same.
	* gcc.dg/spellcheck-options-10.c: Same.
	* gcc.dg/spellcheck-options-12.c: Same.
	* gcc.dg/spellcheck-options-13.c: Same.
	* gcc.dg/spellcheck-options-18.c: Same.
	* gcc.dg/spellcheck-options-19.c: Same.
	* gcc.dg/spellcheck-options-2.c: Same.
	* gcc.dg/spellcheck-options-20.c: Same.
	* gcc.dg/spellcheck-options-3.c: Same.
	* gcc.dg/spellcheck-options-4.c: Same.
	* gcc.dg/spellcheck-options-5.c: Same.
	* gcc.dg/spellcheck-options-6.c: Same.
	* gcc.dg/spellcheck-options-7.c: Same.
	* gcc.dg/spellcheck-options-8.c: Same.
	* gcc.dg/spellcheck-options-9.c: Same.
	* gcc.dg/warn-abs-1.c (tst_notint): Same.
	* gcc.target/i386/spellcheck-options-5.c: Same.

diff --git a/gcc/testsuite/c-c++-common/nonnull-1.c b/gcc/testsuite/c-c++-common/nonnull-1.c
index 2446d6fbcfa..ea987365302 100644
--- a/gcc/testsuite/c-c++-common/nonnull-1.c
+++ b/gcc/testsuite/c-c++-common/nonnull-1.c
@@ -8,27 +8,27 @@ 
 
 void foo(void *bar) __attribute__((nonnull(1)));
 
-void foo(void *bar) { if (!bar) abort(); } /* { dg-warning "nonnull argument" "bar compared to NULL" } */
+void foo(void *bar) { if (!bar) abort(); } /* { dg-warning "'nonnull' argument" "bar compared to NULL" } */
 
 extern int func (char *, char *, char *, char *) __attribute__((nonnull));
 
 int
 func (char *cp1, char *cp2, char *cp3, char *cp4)
 {
-  if (cp1) /* { dg-warning "nonnull argument" "cp1 compared to NULL" } */
+  if (cp1) /* { dg-warning "'nonnull' argument" "cp1 compared to NULL" } */
     return 1;
 
-  if (cp2 == NULL) /* { dg-warning "nonnull argument" "cp2 compared to NULL" } */
+  if (cp2 == NULL) /* { dg-warning "'nonnull' argument" "cp2 compared to NULL" } */
     return 2;
 
-  if (NULL != cp3) /* { dg-warning "nonnull argument" "cp3 compared to NULL" } */
+  if (NULL != cp3) /* { dg-warning "'nonnull' argument" "cp3 compared to NULL" } */
     return 3;
 
-  return cp4 != 0 ? 0 : 1; /* { dg-warning "nonnull argument" "cp4 compared to NULL" } */
+  return cp4 != 0 ? 0 : 1; /* { dg-warning "'nonnull' argument" "cp4 compared to NULL" } */
 }
 
 __attribute__((nonnull (1))) int
 func2 (char *cp)
 {
-  return (cp != NULL) ? 1 : 0; /* { dg-warning "nonnull argument" "cp compared to NULL" { xfail c++ } } */
+  return (cp != NULL) ? 1 : 0; /* { dg-warning "'nonnull' argument" "cp compared to NULL" { xfail c++ } } */
 }
diff --git a/gcc/testsuite/c-c++-common/nonnull-2.c b/gcc/testsuite/c-c++-common/nonnull-2.c
index ebd17a21f03..19574cd1104 100644
--- a/gcc/testsuite/c-c++-common/nonnull-2.c
+++ b/gcc/testsuite/c-c++-common/nonnull-2.c
@@ -7,19 +7,19 @@  void bar (char **);
 __attribute__((nonnull (1, 3))) int
 foo (char *cp1, char *cp2, char *cp3, char *cp4)
 {
-  if (cp1 == (char *) 0) /* { dg-warning "nonnull argument" "cp1 compared to NULL" } */
+  if (cp1 == (char *) 0) /* { dg-warning "'nonnull' argument" "cp1 compared to NULL" } */
     return 1;
 
   cp1 = cp2;
-  if (cp1 == (char *) 0) /* { dg-bogus "nonnull argument" } */
+  if (cp1 == (char *) 0) /* { dg-bogus "'nonnull' argument" } */
     return 2;
 
-  if (!cp4)	   /* { dg-bogus "nonnull argument" } */
+  if (!cp4)	   /* { dg-bogus "'nonnull' argument" } */
     return 3;
 
   char **p = &cp3;
   bar (p);
-  if (cp3 == (char *) 0) /* { dg-bogus "nonnull argument" } */
+  if (cp3 == (char *) 0) /* { dg-bogus "'nonnull' argument" } */
     return 4;
 
   return 5;
diff --git a/gcc/testsuite/c-c++-common/nonnull-3.c b/gcc/testsuite/c-c++-common/nonnull-3.c
index d2ccb24f4fd..42081c889f2 100644
--- a/gcc/testsuite/c-c++-common/nonnull-3.c
+++ b/gcc/testsuite/c-c++-common/nonnull-3.c
@@ -7,5 +7,5 @@  enum { r = 1 };
 __attribute__ ((nonnull (r))) int
 f (int *p)
 {
-  return p == 0; /* { dg-warning "nonnull argument 'p' compared to NULL" } */
+  return p == 0; /* { dg-warning "'nonnull' argument 'p' compared to NULL" } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr35503-1.c b/gcc/testsuite/c-c++-common/pr35503-1.c
index 25e3721df93..11075dd0e06 100644
--- a/gcc/testsuite/c-c++-common/pr35503-1.c
+++ b/gcc/testsuite/c-c++-common/pr35503-1.c
@@ -6,5 +6,5 @@  int foo (char *__restrict buf, const char *__restrict fmt, ...);
 void f(void)
 {
   char buf[100] = "hello";
-  foo (buf, "%s-%s", buf, "world"); /*  { dg-warning "passing argument 1 to restrict-qualified parameter aliases with argument 3" } */
+  foo (buf, "%s-%s", buf, "world"); /*  { dg-warning "passing argument 1 to 'restrict'-qualified parameter aliases with argument 3" } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr35503-2.c b/gcc/testsuite/c-c++-common/pr35503-2.c
index bfcd9448e03..887576c3976 100644
--- a/gcc/testsuite/c-c++-common/pr35503-2.c
+++ b/gcc/testsuite/c-c++-common/pr35503-2.c
@@ -5,7 +5,7 @@  void f(int *__restrict x, int *y, int *__restrict z, int *w);
 
 void foo(int alpha, int beta)
 {
-  f (&alpha, &beta, &alpha, &alpha); /* { dg-warning "passing argument 1 to restrict-qualified parameter aliases with arguments 3, 4" } */
+  f (&alpha, &beta, &alpha, &alpha); /* { dg-warning "passing argument 1 to 'restrict'-qualified parameter aliases with arguments 3, 4" } */
 
 /* { dg-begin-multiline-output "" }
    f (&alpha, &beta, &alpha, &alpha);
diff --git a/gcc/testsuite/c-c++-common/pr35503-3.c b/gcc/testsuite/c-c++-common/pr35503-3.c
index 8cbacabba62..8d4b1fc03ee 100644
--- a/gcc/testsuite/c-c++-common/pr35503-3.c
+++ b/gcc/testsuite/c-c++-common/pr35503-3.c
@@ -5,5 +5,5 @@  void f(int *x, int *__restrict y);
 
 void foo(int a)
 {
-  f (&a, &a); /* { dg-warning "passing argument 2 to restrict-qualified parameter aliases with argument 1" } */
+  f (&a, &a); /* { dg-warning "passing argument 2 to 'restrict'-qualified parameter aliases with argument 1" } */
 }
diff --git a/gcc/testsuite/g++.dg/abi/empty12.C b/gcc/testsuite/g++.dg/abi/empty12.C
index 20d85ff873e..6568fc6202c 100644
--- a/gcc/testsuite/g++.dg/abi/empty12.C
+++ b/gcc/testsuite/g++.dg/abi/empty12.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty12a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty12.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty13.C b/gcc/testsuite/g++.dg/abi/empty13.C
index 0cb9a373e35..9ec188760c7 100644
--- a/gcc/testsuite/g++.dg/abi/empty13.C
+++ b/gcc/testsuite/g++.dg/abi/empty13.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-x c -fabi-version=11" }
 // { dg-additional-sources "empty13a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty13.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty14.C b/gcc/testsuite/g++.dg/abi/empty14.C
index 2868d8ad3f3..7deb463f5e4 100644
--- a/gcc/testsuite/g++.dg/abi/empty14.C
+++ b/gcc/testsuite/g++.dg/abi/empty14.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty14a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty14.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty15.C b/gcc/testsuite/g++.dg/abi/empty15.C
index 12385f78c78..fd36194b459 100644
--- a/gcc/testsuite/g++.dg/abi/empty15.C
+++ b/gcc/testsuite/g++.dg/abi/empty15.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty15a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty15.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty16.C b/gcc/testsuite/g++.dg/abi/empty16.C
index 1ca52f9011e..024b00e7432 100644
--- a/gcc/testsuite/g++.dg/abi/empty16.C
+++ b/gcc/testsuite/g++.dg/abi/empty16.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty16a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty16.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty17.C b/gcc/testsuite/g++.dg/abi/empty17.C
index d386e5481af..a6e58fa4d5f 100644
--- a/gcc/testsuite/g++.dg/abi/empty17.C
+++ b/gcc/testsuite/g++.dg/abi/empty17.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty17a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty17.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty18.C b/gcc/testsuite/g++.dg/abi/empty18.C
index be69c6a2115..6e64dae8d47 100644
--- a/gcc/testsuite/g++.dg/abi/empty18.C
+++ b/gcc/testsuite/g++.dg/abi/empty18.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty18a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty18.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty19.C b/gcc/testsuite/g++.dg/abi/empty19.C
index 84f5b75558b..8707db86be6 100644
--- a/gcc/testsuite/g++.dg/abi/empty19.C
+++ b/gcc/testsuite/g++.dg/abi/empty19.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty19a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty19.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty22.C b/gcc/testsuite/g++.dg/abi/empty22.C
index f4f4a02bf31..d3720f86fde 100644
--- a/gcc/testsuite/g++.dg/abi/empty22.C
+++ b/gcc/testsuite/g++.dg/abi/empty22.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty22a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty22.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty25.C b/gcc/testsuite/g++.dg/abi/empty25.C
index da6ef51ff0d..50a4c266ca0 100644
--- a/gcc/testsuite/g++.dg/abi/empty25.C
+++ b/gcc/testsuite/g++.dg/abi/empty25.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty25a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty25.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/abi/empty26.C b/gcc/testsuite/g++.dg/abi/empty26.C
index ab2f54d8dab..785cdc7d974 100644
--- a/gcc/testsuite/g++.dg/abi/empty26.C
+++ b/gcc/testsuite/g++.dg/abi/empty26.C
@@ -2,7 +2,7 @@ 
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } }
 // { dg-options "-Wabi=11 -x c" }
 // { dg-additional-sources "empty26a.c" }
-// { dg-prune-output "command line option" }
+// { dg-prune-output "command-line option" }
 
 #include "empty26.h"
 extern "C" void fun(struct dummy, struct foo);
diff --git a/gcc/testsuite/g++.dg/concepts/decl-diagnose.C b/gcc/testsuite/g++.dg/concepts/decl-diagnose.C
index 7ac7872efb5..019a8ce1130 100644
--- a/gcc/testsuite/g++.dg/concepts/decl-diagnose.C
+++ b/gcc/testsuite/g++.dg/concepts/decl-diagnose.C
@@ -17,7 +17,7 @@  struct X
   template<typename T>
   static concept bool f6() { return true; } // { dg-error "a concept cannot be a member function" }
   static concept bool x; // { dg-error "declared 'concept'" }
-			 // { dg-error "uninitialized const" "" { target *-*-* } .-1 }
+			 // { dg-error "uninitialized 'const" "" { target *-*-* } .-1 }
   concept int x2; // { dg-error "declared 'concept'" }
   concept ~X(); // { dg-error "a destructor cannot be 'concept'" }
   concept X(); // { dg-error "a constructor cannot be 'concept'" }
diff --git a/gcc/testsuite/g++.dg/conversion/bitfield7.C b/gcc/testsuite/g++.dg/conversion/bitfield7.C
index 1080168dce1..d1b1b096c1e 100644
--- a/gcc/testsuite/g++.dg/conversion/bitfield7.C
+++ b/gcc/testsuite/g++.dg/conversion/bitfield7.C
@@ -12,5 +12,5 @@  int foo (double);
 int
 main ()
 {
-  return foo (s.bar);		// { dg-error "cannot bind bitfield" }
+  return foo (s.bar);		// { dg-error "cannot bind bit-field" }
 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/addressof2.C b/gcc/testsuite/g++.dg/cpp0x/addressof2.C
index a38dce003a7..73942c5f0a5 100644
--- a/gcc/testsuite/g++.dg/cpp0x/addressof2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/addressof2.C
@@ -16,7 +16,7 @@  struct S { int s : 5; int t; void foo (); } s;
 auto c = __builtin_addressof (s);
 auto d = addressof (s);
 auto e = __builtin_addressof (s.s);		// { dg-error "attempt to take address of bit-field" }
-auto f = addressof (s.s);			// { dg-error "cannot bind bitfield" }
+auto f = addressof (s.s);			// { dg-error "cannot bind bit-field" }
 auto g = __builtin_addressof (S{});		// { dg-error "taking address of rvalue" }
 auto h = addressof (S{});			// { dg-error "cannot bind non-const lvalue reference of type" }
 auto i = __builtin_addressof (S::t);		// { dg-error "invalid use of non-static data member" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
index 388a73488e7..733d494c4d7 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
@@ -5,5 +5,5 @@  constexpr int something() { return 3; }
 
 int main() {
   if (constexpr long v = something()) {}
-  if (static long v = something()) { } // { dg-error "decl-specifier invalid" }
+  if (static long v = something()) { } // { dg-error "'decl-specifier' invalid" }
 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
index 336699292a2..9b52a6e00ef 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
@@ -61,7 +61,7 @@  struct pixel2 {	   // { dg-message "no user-provided default constructor" }
   int x, y;
 };
 constexpr pixel2 ur = { 1294, 1024 };// OK
-constexpr pixel2 origin;	     // { dg-error "uninitialized const" }
+constexpr pixel2 origin;	     // { dg-error "uninitialized 'const" }
 
 constexpr const int* addr(const int& ir) { return &ir; } // OK
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
index 1861d404782..5f54c635e64 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
@@ -15,7 +15,7 @@  constexpr A1 a1 = A1();
 extern constexpr int i2; // { dg-error "definition" }
 
 // error: missing initializer
-constexpr A1 a2; // { dg-error "uninitialized const" }
+constexpr A1 a2; // { dg-error "uninitialized 'const" }
 
 const constexpr A1 a3 = A1();
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
index 45b09c17812..b7b31438491 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
@@ -21,7 +21,7 @@  struct B // { dg-message "user-provided default constructor" }
   B() = default;		// { dg-message "not user-provided" }
 };
 
-const B b;			// { dg-error "uninitialized const" }
+const B b;			// { dg-error "uninitialized 'const" }
 
 struct C
 {
diff --git a/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C
index 816077d5401..7a467a154b0 100644
--- a/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C
+++ b/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C
@@ -22,55 +22,55 @@  operator"" J(unsigned long long n) // { dg-warning "1:integer suffix .J. shadowe
 //  Floating-point imaginary...
 
 constexpr long double
-operator"" i(long double n) // { dg-warning "1:floating point suffix .i. shadowed by implementation" "" { target c++11_only } }
+operator"" i(long double n) // { dg-warning "1:floating-point suffix .i. shadowed by implementation" "" { target c++11_only } }
 { return 4.0L * n + 0.0L; }
 
 constexpr long double
-operator"" I(long double n) // { dg-warning "1:floating point suffix .I. shadowed by implementation" }
+operator"" I(long double n) // { dg-warning "1:floating-point suffix .I. shadowed by implementation" }
 { return 4.0L * n + 1.0L; }
 
 constexpr long double
-operator"" j(long double n) // { dg-warning "1:floating point suffix .j. shadowed by implementation" }
+operator"" j(long double n) // { dg-warning "1:floating-point suffix .j. shadowed by implementation" }
 { return 4.0L * n + 2.0L; }
 
 constexpr long double
-operator"" J(long double n) // { dg-warning "1:floating point suffix .J. shadowed by implementation" }
+operator"" J(long double n) // { dg-warning "1:floating-point suffix .J. shadowed by implementation" }
 { return 4.0L * n + 3.0L; }
 
 //  Fixed-point...
 
 constexpr long double
-operator"" k(long double n) // { dg-warning "1:floating point suffix .k. shadowed by implementation" }
+operator"" k(long double n) // { dg-warning "1:floating-point suffix .k. shadowed by implementation" }
 { return 4 * (n + 1) + 0; }
 
 constexpr long double
-operator"" K(long double n) // { dg-warning "1:floating point suffix .K. shadowed by implementation" }
+operator"" K(long double n) // { dg-warning "1:floating-point suffix .K. shadowed by implementation" }
 { return 4 * (n + 1) + 1; }
 
 constexpr long double
-operator"" r(long double n) // { dg-warning "1:floating point suffix .r. shadowed by implementation" }
+operator"" r(long double n) // { dg-warning "1:floating-point suffix .r. shadowed by implementation" }
 { return 4 * (n + 1) + 2; }
 
 constexpr long double
-operator"" R(long double n) // { dg-warning "1:floating point suffix .R. shadowed by implementation" }
+operator"" R(long double n) // { dg-warning "1:floating-point suffix .R. shadowed by implementation" }
 { return 4 * (n + 1) + 3; }
 
 //  Machine-defined...
 
 constexpr long double
-operator"" w(long double n) // { dg-warning "1:floating point suffix .w. shadowed by implementation" }
+operator"" w(long double n) // { dg-warning "1:floating-point suffix .w. shadowed by implementation" }
 { return 4 * (n + 2) + 0; }
 
 constexpr long double
-operator"" W(long double n) // { dg-warning "1:floating point suffix .W. shadowed by implementation" }
+operator"" W(long double n) // { dg-warning "1:floating-point suffix .W. shadowed by implementation" }
 { return 4 * (n + 2) + 1; }
 
 constexpr long double
-operator"" q(long double n) // { dg-warning "1:floating point suffix .q. shadowed by implementation" }
+operator"" q(long double n) // { dg-warning "1:floating-point suffix .q. shadowed by implementation" }
 { return 4 * (n + 2) + 2; }
 
 constexpr long double
-operator"" Q(long double n) // { dg-warning "1:floating point suffix .Q. shadowed by implementation" }
+operator"" Q(long double n) // { dg-warning "1:floating-point suffix .Q. shadowed by implementation" }
 { return 4 * (n + 2) + 3; }
 
 int
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C b/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
index ff23966051c..75117c717cf 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
@@ -34,8 +34,8 @@  struct Derived3 : Base // { dg-message "user-provided default constructor" }
 
 void f()
 {
-    const A a; // { dg-error "uninitialized const" }
-    const Derived d; // { dg-error "uninitialized const" }
-    const Derived2 d2; // { dg-error "uninitialized const" }
-    const Derived3 d3; // { dg-error "uninitialized const" }
+    const A a; // { dg-error "uninitialized 'const" }
+    const Derived d; // { dg-error "uninitialized 'const" }
+    const Derived2 d2; // { dg-error "uninitialized 'const" }
+    const Derived3 d3; // { dg-error "uninitialized 'const" }
 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr83993.C b/gcc/testsuite/g++.dg/cpp0x/pr83993.C
index 17b7a641957..c256257a5c1 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr83993.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr83993.C
@@ -7,7 +7,7 @@  const int b[5] = { 1, 2, 3, 4, 5 };
 extern const int c[4];
 constexpr const int *d = &a[0];
 constexpr const int *d2 = a;
-constexpr const int *e = &a[1];		// { dg-error "non-zero array subscript '1' is used with array 'a' of type 'const int \\\[\\\]' with unknown bounds" }
+constexpr const int *e = &a[1];		// { dg-error "nonzero array subscript '1' is used with array 'a' of type 'const int \\\[\\\]' with unknown bounds" }
 constexpr const int *f = &b[0];
 constexpr const int *f2 = b;
 constexpr const int *g = &b[5];
@@ -30,7 +30,7 @@  foo ()
 
 constexpr const int *m = &l[0];
 constexpr const int *m2 = l;
-constexpr const int *n = &l[1];		// { dg-error "non-zero array subscript '1' is used with array 'l' of type 'const int \\\[\\\]' with unknown bounds" }
+constexpr const int *n = &l[1];		// { dg-error "nonzero array subscript '1' is used with array 'l' of type 'const int \\\[\\\]' with unknown bounds" }
 static_assert (d == d2 && f == f2 && i == i2 && m == m2, "");
 const int o[] = { 1, 2 };
 constexpr const int *p = &o[0];
@@ -40,7 +40,7 @@  constexpr const int *r = &o[3];		// { dg-error "array subscript value '3' is out
 struct S { char a; char b[]; } s;
 constexpr const char *t = &s.b[0];
 constexpr const char *t2 = s.b;
-constexpr const char *u = &s.b[1];	// { dg-error "non-zero array subscript '1' is used with array of type 'char \\\[\\\]' with unknown bounds" }
+constexpr const char *u = &s.b[1];	// { dg-error "nonzero array subscript '1' is used with array of type 'char \\\[\\\]' with unknown bounds" }
 struct V { int a; };
 extern V v[];
 constexpr V *w = &v[0];
diff --git a/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C
index 72b8546ae58..d251c744999 100644
--- a/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C
+++ b/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C
@@ -22,55 +22,55 @@  operator"" J(unsigned long long n) // { dg-warning "1:integer suffix .J. shadowe
 //  Floating-point imaginary...
 
 constexpr long double
-operator"" i(long double n) // { dg-warning "1:floating point suffix .i. shadowed by implementation" "" { target c++11_only } }
+operator"" i(long double n) // { dg-warning "1:floating-point suffix .i. shadowed by implementation" "" { target c++11_only } }
 { return 4.0L * n + 0.0L; }
 
 constexpr long double
-operator"" I(long double n) // { dg-warning "1:floating point suffix .I. shadowed by implementation" }
+operator"" I(long double n) // { dg-warning "1:floating-point suffix .I. shadowed by implementation" }
 { return 4.0L * n + 1.0L; }
 
 constexpr long double
-operator"" j(long double n) // { dg-warning "1:floating point suffix .j. shadowed by implementation" }
+operator"" j(long double n) // { dg-warning "1:floating-point suffix .j. shadowed by implementation" }
 { return 4.0L * n + 2.0L; }
 
 constexpr long double
-operator"" J(long double n) // { dg-warning "1:floating point suffix .J. shadowed by implementation" }
+operator"" J(long double n) // { dg-warning "1:floating-point suffix .J. shadowed by implementation" }
 { return 4.0L * n + 3.0L; }
 
 //  Fixed-point...
 
 constexpr long double
-operator"" k(long double n) // { dg-warning "1:floating point suffix .k. shadowed by implementation" }
+operator"" k(long double n) // { dg-warning "1:floating-point suffix .k. shadowed by implementation" }
 { return 4 * (n + 1) + 0; }
 
 constexpr long double
-operator"" K(long double n) // { dg-warning "1:floating point suffix .K. shadowed by implementation" }
+operator"" K(long double n) // { dg-warning "1:floating-point suffix .K. shadowed by implementation" }
 { return 4 * (n + 1) + 1; }
 
 constexpr long double
-operator"" r(long double n) // { dg-warning "1:floating point suffix .r. shadowed by implementation" }
+operator"" r(long double n) // { dg-warning "1:floating-point suffix .r. shadowed by implementation" }
 { return 4 * (n + 1) + 2; }
 
 constexpr long double
-operator"" R(long double n) // { dg-warning "1:floating point suffix .R. shadowed by implementation" }
+operator"" R(long double n) // { dg-warning "1:floating-point suffix .R. shadowed by implementation" }
 { return 4 * (n + 1) + 3; }
 
 //  Machine-defined...
 
 constexpr long double
-operator"" w(long double n) // { dg-warning "1:floating point suffix .w. shadowed by implementation" }
+operator"" w(long double n) // { dg-warning "1:floating-point suffix .w. shadowed by implementation" }
 { return 4 * (n + 2) + 0; }
 
 constexpr long double
-operator"" W(long double n) // { dg-warning "1:floating point suffix .W. shadowed by implementation" }
+operator"" W(long double n) // { dg-warning "1:floating-point suffix .W. shadowed by implementation" }
 { return 4 * (n + 2) + 1; }
 
 constexpr long double
-operator"" q(long double n) // { dg-warning "1:floating point suffix .q. shadowed by implementation" }
+operator"" q(long double n) // { dg-warning "1:floating-point suffix .q. shadowed by implementation" }
 { return 4 * (n + 2) + 2; }
 
 constexpr long double
-operator"" Q(long double n) // { dg-warning "1:floating point suffix .Q. shadowed by implementation" }
+operator"" Q(long double n) // { dg-warning "1:floating-point suffix .Q. shadowed by implementation" }
 { return 4 * (n + 2) + 3; }
 
 int
diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C
index c63559060e9..fdddd8d84ed 100644
--- a/gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C
+++ b/gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C
@@ -2,7 +2,7 @@ 
 
 //  Test that the standard suffixes shadow any user-defined suffixes of the same name.
 long double
-operator"" L(long double x)  // { dg-warning "floating point suffix|shadowed by implementation" }
+operator"" L(long double x)  // { dg-warning "floating-point suffix|shadowed by implementation" }
 { return x; }
 
 unsigned long long int
@@ -10,7 +10,7 @@  operator"" ULL(unsigned long long int k)  // { dg-warning "integer suffix|shadow
 { return k; }
 
 long double
-operator"" l(long double x)  // { dg-warning "floating point suffix|shadowed by implementation" }
+operator"" l(long double x)  // { dg-warning "floating-point suffix|shadowed by implementation" }
 { return x; }
 
 unsigned long long int
diff --git a/gcc/testsuite/g++.dg/cpp1z/inline-var2.C b/gcc/testsuite/g++.dg/cpp1z/inline-var2.C
index 1a016fa8216..236f6ecb133 100644
--- a/gcc/testsuite/g++.dg/cpp1z/inline-var2.C
+++ b/gcc/testsuite/g++.dg/cpp1z/inline-var2.C
@@ -47,7 +47,7 @@  struct W
 {
   static inline int var24;			// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
   static inline const int var25;		// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
-						// { dg-error "uninitialized const" "" { target *-*-* } .-1 }
+						// { dg-error "uninitialized 'const" "" { target *-*-* } .-1 }
   static inline int var26 = 5;			// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
   static inline const int var27 = 6;		// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
   static inline double var28 = { 4.0 };		// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
@@ -90,7 +90,7 @@  struct Z
 {
   static inline int var37;			// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
   static inline const int var38;		// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
-						// { dg-error "uninitialized const" "" { target *-*-* } .-1 }
+						// { dg-error "uninitialized 'const" "" { target *-*-* } .-1 }
   static inline int var39 = 5;			// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
   static inline const int var40 = 6;		// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
   static inline double var41 = { 4.0 };		// { dg-warning "10:inline variables are only available with" "" { target c++14_down } }
diff --git a/gcc/testsuite/g++.dg/init/pr42844.C b/gcc/testsuite/g++.dg/init/pr42844.C
index 299a30a91d2..9b7ed05de0e 100644
--- a/gcc/testsuite/g++.dg/init/pr42844.C
+++ b/gcc/testsuite/g++.dg/init/pr42844.C
@@ -22,22 +22,22 @@  struct G { T t; }; // { dg-message "user-provided default constructor" }
 
 void f ()
 {
-  B const b;    // { dg-error "uninitialized const" }
+  B const b;    // { dg-error "uninitialized 'const" }
   extern B const bext;
 
-  C const c[ 1 ]; // { dg-error "uninitialized const" }
+  C const c[ 1 ]; // { dg-error "uninitialized 'const" }
   extern C const cext[ 1 ];
 
   D const d;
   extern D const dext;
 
-  E const e;	// { dg-error "uninitialized const" }
+  E const e;	// { dg-error "uninitialized 'const" }
   extern E const eext;
 
-  F<int> const f; // { dg-error "uninitialized const" }
+  F<int> const f; // { dg-error "uninitialized 'const" }
   extern F<int> const fext;
 
-  G<int> const g; // { dg-error "uninitialized const" }
+  G<int> const g; // { dg-error "uninitialized 'const" }
   extern G<int> const gext;
 }
 
@@ -48,7 +48,7 @@  struct I : A { int i; }; // { dg-message "user-provided default constructor" }
 template <class T>
 void g ()
 {
-  T const t; // { dg-error "uninitialized const" }
+  T const t; // { dg-error "uninitialized 'const" }
   extern T const text;
 }
 
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr20280.C b/gcc/testsuite/g++.dg/tree-ssa/pr20280.C
index ec4dad70620..334ed8a75e0 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr20280.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr20280.C
@@ -44,9 +44,9 @@  void f(X &x, bool b)
   (void)(b ? x.i : x.k);
   (void)(b ? x.j : x.k);
 
-  g (b ? x.i : x.j); // { dg-error "cannot bind bitfield" }
-  g (b ? x.i : x.k); // { dg-error "cannot bind bitfield" }
-  g (b ? x.j : x.k); // { dg-error "cannot bind bitfield" }
+  g (b ? x.i : x.j); // { dg-error "cannot bind bit-field" }
+  g (b ? x.i : x.k); // { dg-error "cannot bind bit-field" }
+  g (b ? x.j : x.k); // { dg-error "cannot bind bit-field" }
 
   // It's not entirely clear whether these should be accepted.  The
   // conditional expressions are lvalues for sure, and 8.5.3/5 exempts
diff --git a/gcc/testsuite/g++.dg/warn/Wfloat-equal-1.C b/gcc/testsuite/g++.dg/warn/Wfloat-equal-1.C
index 36b3fa53f3f..1b23611bdc0 100644
--- a/gcc/testsuite/g++.dg/warn/Wfloat-equal-1.C
+++ b/gcc/testsuite/g++.dg/warn/Wfloat-equal-1.C
@@ -4,7 +4,7 @@ 
 
 double a, b;
 _Complex double c, d;
-int f(void) { return a == b; } /* { dg-warning "comparing floating point" } */
-int g(void) { return c == d; } /* { dg-warning "comparing floating point" } */
-int h(void) { return a != b; } /* { dg-warning "comparing floating point" } */
-int i(void) { return c != d; } /* { dg-warning "comparing floating point" } */
+int f(void) { return a == b; } /* { dg-warning "comparing floating-point" } */
+int g(void) { return c == d; } /* { dg-warning "comparing floating-point" } */
+int h(void) { return a != b; } /* { dg-warning "comparing floating-point" } */
+int i(void) { return c != d; } /* { dg-warning "comparing floating-point" } */
diff --git a/gcc/testsuite/g++.dg/warn/Wrestrict-1.C b/gcc/testsuite/g++.dg/warn/Wrestrict-1.C
index fe844f18c43..441ff3482bc 100644
--- a/gcc/testsuite/g++.dg/warn/Wrestrict-1.C
+++ b/gcc/testsuite/g++.dg/warn/Wrestrict-1.C
@@ -7,6 +7,6 @@  void foo (char *__restrict, char *__restrict = __null);
 void
 bar (char *p)
 {
-  foo (p, p);	// { dg-warning "to restrict-qualified parameter aliases with" }
+  foo (p, p);	// { dg-warning "to 'restrict'-qualified parameter aliases with" }
   foo (p);
 }
diff --git a/gcc/testsuite/g++.dg/warn/Wrestrict-2.C b/gcc/testsuite/g++.dg/warn/Wrestrict-2.C
index 4bab03bc850..72957d0f551 100644
--- a/gcc/testsuite/g++.dg/warn/Wrestrict-2.C
+++ b/gcc/testsuite/g++.dg/warn/Wrestrict-2.C
@@ -8,8 +8,8 @@  template <int N>
 void
 bar (char **p)
 {
-  foo (p[0], p[0]);	// { dg-warning "to restrict-qualified parameter aliases with" }
-  foo (p[0], p[N]);	// { dg-warning "to restrict-qualified parameter aliases with" }
+  foo (p[0], p[0]);	// { dg-warning "to 'restrict'-qualified parameter aliases with" }
+  foo (p[0], p[N]);	// { dg-warning "to 'restrict'-qualified parameter aliases with" }
   foo (p[0]);
 }
 
@@ -17,8 +17,8 @@  template <int N>
 void
 bar2 (char **p)
 {
-  foo (p[0], p[0]);	// { dg-warning "to restrict-qualified parameter aliases with" }
-  foo (p[0], p[N]);	// { dg-bogus "to restrict-qualified parameter aliases with" }
+  foo (p[0], p[0]);	// { dg-warning "to 'restrict'-qualified parameter aliases with" }
+  foo (p[0], p[N]);	// { dg-bogus "to 'restrict'-qualified parameter aliases with" }
   foo (p[0]);
 }
 
diff --git a/gcc/testsuite/g++.dg/warn/nonnull3.C b/gcc/testsuite/g++.dg/warn/nonnull3.C
index d82fa31d957..e869b0f5de9 100644
--- a/gcc/testsuite/g++.dg/warn/nonnull3.C
+++ b/gcc/testsuite/g++.dg/warn/nonnull3.C
@@ -16,4 +16,4 @@  void A::bar (B *)
 {
   foo ((int B::*) nullptr);
 }
-// { dg-warning "nonnull argument" "" {target "*-*-*"} 0 }
+// { dg-warning "'nonnull' argument" "" {target "*-*-*"} 0 }
diff --git a/gcc/testsuite/g++.dg/warn/pr8715.C b/gcc/testsuite/g++.dg/warn/pr8715.C
index 330c148bb59..fccb25aa7e5 100644
--- a/gcc/testsuite/g++.dg/warn/pr8715.C
+++ b/gcc/testsuite/g++.dg/warn/pr8715.C
@@ -5,7 +5,7 @@  int foo()
 {
   unsigned char b = '1';
 
-  bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */
+  bool x = ~b; /* { dg-warning "promoted bitwise complement of an unsigned value is always nonzero" } */
 
   return 0;
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond5.C b/gcc/testsuite/g++.old-deja/g++.other/cond5.C
index 994ea6d9522..f4d16e9760b 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/cond5.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond5.C
@@ -23,8 +23,8 @@  void fn(int i)
   int j;
 
   j = (i ? e1 : e2);    // { dg-warning "mismatch" }
-  d = (i ? e1 : 1.0);   // { dg-warning "non-enumeral" }
-  d = (i ? 1.0 : e2);   // { dg-warning "non-enumeral" }
+  d = (i ? e1 : 1.0);   // { dg-warning "non-enumerated" }
+  d = (i ? 1.0 : e2);   // { dg-warning "non-enumerated" }
   E1 e = (i ? e1 : e1); // ok
   j = (i ? 1 : e2);     // ok
   j = (i ? e1 : 1);     // ok
diff --git a/gcc/testsuite/gcc.dg/Wfloat-equal-1.c b/gcc/testsuite/gcc.dg/Wfloat-equal-1.c
index 36b3fa53f3f..1b23611bdc0 100644
--- a/gcc/testsuite/gcc.dg/Wfloat-equal-1.c
+++ b/gcc/testsuite/gcc.dg/Wfloat-equal-1.c
@@ -4,7 +4,7 @@ 
 
 double a, b;
 _Complex double c, d;
-int f(void) { return a == b; } /* { dg-warning "comparing floating point" } */
-int g(void) { return c == d; } /* { dg-warning "comparing floating point" } */
-int h(void) { return a != b; } /* { dg-warning "comparing floating point" } */
-int i(void) { return c != d; } /* { dg-warning "comparing floating point" } */
+int f(void) { return a == b; } /* { dg-warning "comparing floating-point" } */
+int g(void) { return c == d; } /* { dg-warning "comparing floating-point" } */
+int h(void) { return a != b; } /* { dg-warning "comparing floating-point" } */
+int i(void) { return c != d; } /* { dg-warning "comparing floating-point" } */
diff --git a/gcc/testsuite/gcc.dg/attr-noinline.c b/gcc/testsuite/gcc.dg/attr-noinline.c
index 13cc6600c28..b77a3466036 100644
--- a/gcc/testsuite/gcc.dg/attr-noinline.c
+++ b/gcc/testsuite/gcc.dg/attr-noinline.c
@@ -3,15 +3,15 @@ 
 
 extern int t();
 
-static inline void __attribute__((__noinline__)) function_definition(void) {t();} /* { dg-warning "inline function \[^\n\]* given attribute noinline" } */
+static inline void __attribute__((__noinline__)) function_definition(void) {t();} /* { dg-warning "inline function \[^\n\]* given attribute 'noinline'" } */
 
-static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute noinline" } */
+static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute 'noinline'" } */
 
 static void function_declaration_both_before(void) {t();}
 
 static void function_declaration_both_after(void);
 
-static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" } */
+static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute .noinline.|declared inline after its definition)" } */
 
 static void function_declaration_both_after(void) {t();}
 
diff --git a/gcc/testsuite/gcc.dg/attr-noipa.c b/gcc/testsuite/gcc.dg/attr-noipa.c
index e2349b6a418..b2485bb7f0b 100644
--- a/gcc/testsuite/gcc.dg/attr-noipa.c
+++ b/gcc/testsuite/gcc.dg/attr-noipa.c
@@ -4,7 +4,7 @@ 
 /* { dg-require-effective-target alloca } */
 
 static inline int __attribute__((noipa))
-fn1 (void) /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
+fn1 (void) /* { dg-warning "inline function \[^\n\]* given attribute 'noinline'" "" } */
 {
   return 1;
 }
diff --git a/gcc/testsuite/gcc.dg/attr-weakref-2.c b/gcc/testsuite/gcc.dg/attr-weakref-2.c
index 75cc0779c57..172a4a63e6a 100644
--- a/gcc/testsuite/gcc.dg/attr-weakref-2.c
+++ b/gcc/testsuite/gcc.dg/attr-weakref-2.c
@@ -4,4 +4,4 @@ 
 typedef int vtype;
 
 extern vtype wv1;
-extern vtype Wv1a __attribute__((weakref ("wv1"))); /* { dg-error "weakref 'Wv1a' must have static linkage" } */
+extern vtype Wv1a __attribute__((weakref ("wv1"))); /* { dg-error "'weakref' symbol 'Wv1a' must have static linkage" } */
diff --git a/gcc/testsuite/gcc.dg/cast-1.c b/gcc/testsuite/gcc.dg/cast-1.c
index 19ed4f4208d..335a090d4f9 100644
--- a/gcc/testsuite/gcc.dg/cast-1.c
+++ b/gcc/testsuite/gcc.dg/cast-1.c
@@ -24,8 +24,8 @@  f (void)
   (union u) l; /* { dg-error "cast to union type from type not present in union" } */
   (int) sv; /* { dg-error "aggregate value used where an integer was expected" } */
   (int) uv; /* { dg-error "aggregate value used where an integer was expected" } */
-  (float) sv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (float) uv; /* { dg-error "aggregate value used where a floating point was expected" } */
+  (float) sv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (float) uv; /* { dg-error "aggregate value used where a floating-point was expected" } */
   (_Complex double) sv; /* { dg-error "aggregate value used where a complex was expected" } */
   (_Complex double) uv; /* { dg-error "aggregate value used where a complex was expected" } */
   (void *) sv; /* { dg-error "cannot convert to a pointer type" } */
diff --git a/gcc/testsuite/gcc.dg/cast-2.c b/gcc/testsuite/gcc.dg/cast-2.c
index 24f63b2e8d4..2523ac4cbc9 100644
--- a/gcc/testsuite/gcc.dg/cast-2.c
+++ b/gcc/testsuite/gcc.dg/cast-2.c
@@ -24,8 +24,8 @@  f (void)
   (union u) l; /* { dg-error "cast to union type from type not present in union" } */
   (int) sv; /* { dg-error "aggregate value used where an integer was expected" } */
   (int) uv; /* { dg-error "aggregate value used where an integer was expected" } */
-  (float) sv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (float) uv; /* { dg-error "aggregate value used where a floating point was expected" } */
+  (float) sv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (float) uv; /* { dg-error "aggregate value used where a floating-point was expected" } */
   (_Complex double) sv; /* { dg-error "aggregate value used where a complex was expected" } */
   (_Complex double) uv; /* { dg-error "aggregate value used where a complex was expected" } */
   (void *) sv; /* { dg-error "cannot convert to a pointer type" } */
diff --git a/gcc/testsuite/gcc.dg/cast-3.c b/gcc/testsuite/gcc.dg/cast-3.c
index d8ae3a0fce2..1e3f5f43c54 100644
--- a/gcc/testsuite/gcc.dg/cast-3.c
+++ b/gcc/testsuite/gcc.dg/cast-3.c
@@ -24,8 +24,8 @@  f (void)
   (union u) l; /* { dg-error "cast to union type from type not present in union" } */
   (int) sv; /* { dg-error "aggregate value used where an integer was expected" } */
   (int) uv; /* { dg-error "aggregate value used where an integer was expected" } */
-  (float) sv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (float) uv; /* { dg-error "aggregate value used where a floating point was expected" } */
+  (float) sv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (float) uv; /* { dg-error "aggregate value used where a floating-point was expected" } */
   (_Complex double) sv; /* { dg-error "aggregate value used where a complex was expected" } */
   (_Complex double) uv; /* { dg-error "aggregate value used where a complex was expected" } */
   (void *) sv; /* { dg-error "cannot convert to a pointer type" } */
diff --git a/gcc/testsuite/gcc.dg/dfp/cast-bad.c b/gcc/testsuite/gcc.dg/dfp/cast-bad.c
index 8d22ba3f8c1..fcaf22db9b9 100644
--- a/gcc/testsuite/gcc.dg/dfp/cast-bad.c
+++ b/gcc/testsuite/gcc.dg/dfp/cast-bad.c
@@ -31,10 +31,10 @@  f (void)
   (struct s) d128; /* { dg-error "conversion to non-scalar type requested" } */
   (union u) d128; /* { dg-error "cast to union type from type not present in union" } */
 		
-  (_Decimal32) sv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (_Decimal32) uv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (_Decimal64) sv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (_Decimal64) uv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (_Decimal128) sv; /* { dg-error "aggregate value used where a floating point was expected" } */
-  (_Decimal128) uv; /* { dg-error "aggregate value used where a floating point was expected" } */
+  (_Decimal32) sv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (_Decimal32) uv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (_Decimal64) sv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (_Decimal64) uv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (_Decimal128) sv; /* { dg-error "aggregate value used where a floating-point was expected" } */
+  (_Decimal128) uv; /* { dg-error "aggregate value used where a floating-point was expected" } */
 }
diff --git a/gcc/testsuite/gcc.dg/dfp/warn-abs-2.c b/gcc/testsuite/gcc.dg/dfp/warn-abs-2.c
index c1a1994997f..403b0394298 100644
--- a/gcc/testsuite/gcc.dg/dfp/warn-abs-2.c
+++ b/gcc/testsuite/gcc.dg/dfp/warn-abs-2.c
@@ -8,16 +8,16 @@ 
 void tst_decimal (_Decimal32 *p32, _Decimal64 *p64, _Decimal128 *p128)
 {
   *p32 = abs(*p32);       /* { dg-warning "using integer absolute value function" } */
-  *p64 = fabs(*p64);      /* { dg-warning "using floating point absolute value function" } */
+  *p64 = fabs(*p64);      /* { dg-warning "using floating-point absolute value function" } */
   *p128 = cabsl(*p128);   /* { dg-warning "using complex absolute value function" } */
 }
 
 void tst_notdecimal (int *pi, double *pd, long double *pld, complex double *pc)
 {
-  *pi = __builtin_fabsd32 (*pi);   /* { dg-warning "using decimal floating point absolute value function" } */
-  *pd = __builtin_fabsd64 (*pd);   /* { dg-warning "using decimal floating point absolute value function" } */
-  *pld = __builtin_fabsd64 (*pld); /* { dg-warning "using decimal floating point absolute value function" } */
-  *pc = __builtin_fabsd128 (*pc);  /* { dg-warning "using decimal floating point absolute value function" } */
+  *pi = __builtin_fabsd32 (*pi);   /* { dg-warning "using decimal floating-point absolute value function" } */
+  *pd = __builtin_fabsd64 (*pd);   /* { dg-warning "using decimal floating-point absolute value function" } */
+  *pld = __builtin_fabsd64 (*pld); /* { dg-warning "using decimal floating-point absolute value function" } */
+  *pc = __builtin_fabsd128 (*pc);  /* { dg-warning "using decimal floating-point absolute value function" } */
 }
 
 void
diff --git a/gcc/testsuite/gcc.dg/enum-mode-1.c b/gcc/testsuite/gcc.dg/enum-mode-1.c
index 09276b7fac0..9d3ea26d6d3 100644
--- a/gcc/testsuite/gcc.dg/enum-mode-1.c
+++ b/gcc/testsuite/gcc.dg/enum-mode-1.c
@@ -1,10 +1,10 @@ 
 /* { dg-do compile } */
 
-enum e1 { A = 256 } __attribute__((__mode__(__byte__))); /* { dg-error "specified mode too small for enumeral values" } */
-enum e2 { B = 256 } __attribute__((__packed__, __mode__(__byte__))); /* { dg-error "specified mode too small for enumeral values" } */
+enum e1 { A = 256 } __attribute__((__mode__(__byte__))); /* { dg-error "specified mode too small for enumerated values" } */
+enum e2 { B = 256 } __attribute__((__packed__, __mode__(__byte__))); /* { dg-error "specified mode too small for enumerated values" } */
 
-enum e3 { C = __INT_MAX__ } __attribute__((__mode__(__QI__))); /* { dg-error "specified mode too small for enumeral values" } */
-enum e4 { D = __INT_MAX__ } __attribute__((__packed__, __mode__(__QI__))); /* { dg-error "specified mode too small for enumeral values" } */
+enum e3 { C = __INT_MAX__ } __attribute__((__mode__(__QI__))); /* { dg-error "specified mode too small for enumerated values" } */
+enum e4 { D = __INT_MAX__ } __attribute__((__packed__, __mode__(__QI__))); /* { dg-error "specified mode too small for enumerated values" } */
 
-enum e5 { E = __INT_MAX__ } __attribute__((__mode__(__HI__))); /* { dg-error "specified mode too small for enumeral values" "" { xfail int16 } } */
-enum e6 { F = __INT_MAX__ } __attribute__((__packed__, __mode__(__HI__))); /* { dg-error "specified mode too small for enumeral values" "" { xfail int16 } } */
+enum e5 { E = __INT_MAX__ } __attribute__((__mode__(__HI__))); /* { dg-error "specified mode too small for enumerated values" "" { xfail int16 } } */
+enum e6 { F = __INT_MAX__ } __attribute__((__packed__, __mode__(__HI__))); /* { dg-error "specified mode too small for enumerated values" "" { xfail int16 } } */
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
index 87614567b91..4a64d5460c6 100644
--- a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
@@ -1,7 +1,7 @@ 
 /* Test for GCC diagnostic formats.  */
 /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
 /* { dg-do compile } */
-/* { dg-options "-Wformat" } */
+/* { dg-options "-Wformat -Wno-format-diag" } */
 
 #include "format.h"
 
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-11.c
@@ -0,0 +1,455 @@ 
+/* Test warnings for common punctuation, quoting, and spelling issues
+   in GCC diagnostics.
+   { dg-do compile }
+   { dg-options "-Wformat -Wformat-diag" } */
+
+/* Magic identifiers must be set before the attribute is used.  */
+
+typedef long long __gcc_host_wide_int__;
+
+typedef struct location_s
+{
+  const char *file;
+  int line;
+} location_t;
+
+union tree_node;
+typedef union tree_node *tree;
+
+/* Define gimple as a dummy type.  The typedef must be provided for
+   the C test to find the symbol.  */
+typedef struct gimple gimple;
+
+/* Likewise for cgraph_node.  */
+typedef struct cgraph_node cgraph_node;
+
+#define ATTR(...)    __attribute__ ((__VA_ARGS__))
+#define FORMAT(kind) ATTR (format (__gcc_## kind ##__, 1, 2))
+
+/* Raw formatting function like pp_format.  */
+void diag_raw (const char*, ...) ATTR (format (__gcc_diag_raw__, 1, 2));
+void cdiag_raw (const char*, ...) ATTR (format (__gcc_cdiag_raw__, 1, 2));
+void tdiag_raw (const char*, ...) ATTR (format (gcc_tdiag_raw, 1, 2));
+void cxxdiag_raw (const char*, ...) ATTR (format (gcc_cxxdiag_raw, 1, 2));
+
+/* Basic formatting function_format.  */
+void diag (const char*, ...) FORMAT (diag);
+
+/* Diagnostic formatting function like error or warning declared
+   by the C front end.  */
+void cdiag (const char*, ...) FORMAT (cdiag);
+
+/* Diagnostic formatting function like error or warning declared
+   by the middle-end or back-end.  */
+void tdiag (const char*, ...) FORMAT (tdiag);
+
+/* Diagnostic formatting function like error or warning declared
+   by the C++ front-end.  */
+void cxxdiag (const char*, ...) FORMAT (cxxdiag);
+
+
+/* Verify that functions declared with __gcc_diag_raw__ attribute
+   are not subject to -Wformat-diag.  */
+
+void test_diag_raw (tree t, gimple *gc)
+{
+  diag_raw ("a  b");
+  diag_raw ("newline\n");
+  diag_raw ("lone period.");
+  diag_raw ("multiple punctuators: !!!");
+  diag_raw ("unbalanced paren (");
+  diag_raw ("keyword alignas and identifier_with_underscores");
+  diag_raw ("disable __builtin_abs with the -fno-builtin-abs option");
+  diag_raw ("who says I can't have no stinkin' contractions? ");
+
+  cdiag_raw ("__atomic_sync (%qE) == 7???", t);
+  tdiag_raw ("__builtin_abs (%E) < 0!?!", t);
+  cxxdiag_raw ("template <> int f (%E", t);
+}
+
+/* Verify that functions declared with the C front-end __gcc_cdiag__
+   attribute detect invalid whitespace in format strings.  */
+
+void test_cdiag_whitespace (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  /* Verify that strings of leading spaces don't trigger a warning.  */
+  cdiag (" a");
+  cdiag ("  b");
+  cdiag ("   c");
+  cdiag ("%< %>a");
+  cdiag ("%<  %>a");
+  cdiag ("a b");
+  cdiag ("a  b");           /* { dg-warning "unquoted sequence of 2 consecutive space characters" } */
+  cdiag ("a ");             /* { dg-warning "spurious trailing space" } */
+  cdiag ("a  ");            /* { dg-warning "spurious trailing space" } */
+  cdiag ("a%< %>");
+  cdiag ("a%< %>%< %>");
+  cdiag ("a%< %> ");        /* { dg-warning "spurious trailing space" } */
+  cdiag ("a%< %>  %< %>");  /* { dg-warning "unquoted sequence of 2 consecutive space characters" } */
+
+  /* It's debatable whether the following two formst strings should
+     be diagnosed.  They aren't only because it's simpler that way.  */
+  cdiag ("a %< %>");
+  cdiag ("a%< %> %< %>");
+
+  /* Exercise other whitespace characters.  */
+  cdiag ("a\fb");           /* { dg-warning "unquoted whitespace character '\\\\x0c'" } */
+  cdiag ("a\nb");           /* { dg-warning "unquoted whitespace character '\\\\x0a'" } */
+  cdiag ("a\rb");           /* { dg-warning "unquoted whitespace character '\\\\x0d'" } */
+  cdiag ("a\vb");           /* { dg-warning "unquoted whitespace character '\\\\x0b'" } */
+
+  cdiag ("First sentence.  And a next.");
+  cdiag ("First sentence.  not capitalized sentence"); /* { dg-warning "inconsistent capitalization" } */
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+
+  /* Verify that the warning can be suppressed.  */
+  cdiag ("\ta\b    c\vb\n");
+
+#pragma GCC diagnostic pop
+}
+
+
+void test_cdiag_control (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("\1");             /* { dg-warning "unquoted control character '\\\\x01'" } */
+  cdiag ("a\ab");           /* { dg-warning "unquoted control character '\\\\x07'" } */
+  cdiag ("a\bb");           /* { dg-warning "unquoted control character '\\\\x08'" } */
+}
+
+
+void test_cdiag_punct (tree t, gimple *gc, int i)
+{
+  (void)&t; (void)&gc;
+
+  /* Exercise the period.  */
+  cdiag (".abc");           /* { dg-warning "spurious leading punctuation sequence .\.." } */
+  cdiag ("abc;");           /* { dg-warning "spurious trailing punctuation sequence .;." } */
+  /* Verify that sentences that start with an uppercase letter and end
+     in a period are not diagnosed.  */
+  cdiag ("This is a full sentence.");
+  cdiag ("Capitalized sentence (with a parethetical note).");
+  cdiag ("Not a full sentence;");   /* { dg-warning "spurious trailing punctuation sequence .;." } */
+  cdiag ("Neither is this one,");   /* { dg-warning "spurious trailing punctuation sequence .,." } */
+
+  /* Exercise the ellipsis.  */
+  cdiag ("this message...");
+  cdiag ("...continues here");
+  cdiag ("but...not here"); /* { dg-warning "unquoted sequence of 3 consecutive punctuation characters" } */
+
+  /* Verify that parenthesized sentences are accepted, even the whole
+     meesage (done in the C++ front end).  */
+  cdiag ("null argument where non-null required (argument %i)", i);
+  cdiag ("null (argument %i) where non-null required", i);
+  cdiag ("(see what comes next)");
+
+  /* Verify that only a single trailing colon is accepted.  */
+  cdiag ("candidates are:");
+  cdiag ("candidates are::"); /* { dg-warning "spurious trailing punctuation sequence .::." } */
+
+  /* Exercise C++.  */
+  cdiag ("C++ is cool");
+  cdiag ("this is c++");
+  cdiag ("you can do this in C++ but not in C");
+
+  /* Also verify that G++ is accepted.  */
+  cdiag ("G++ rocks");
+  cdiag ("this is accepted by g++");
+  cdiag ("valid in G++ (or g++) but not in gcc");
+
+  /* Exercise parenthetical note followed by a colon, semicolon,
+     or a comma.  */
+  cdiag ("found a bug (here):");
+  cdiag ("because of another bug (over there); fix it");
+
+  cdiag ("found foo (123): go look at it");
+  cdiag ("missed bar (abc); will try harder next time");
+
+  cdiag ("expected this (or that), got something else (or who knows what)");
+
+  /* Exercise parenthetical note with a question mark.  */
+  cdiag ("hmmm (did you really mean that?)");
+  cdiag ("error (did you mean %<foo()%>?)");
+  /* And a question mark after a parenthetical note.  */
+  cdiag ("did you mean this (or that)?");
+
+  /* But make sure unbalanced parenthese are diagnosed.  */
+  cdiag ("or this or the other)?");   /* { dg-warning "unbalanced punctuation character '\\\)'" } */
+
+  cdiag ("## Heading");               /* { dg-warning "spurious leading punctuation sequence .##." } */
+  cdiag ("## %s ##", "1");            /* { dg-warning "spurious (leading|trailing) punctuation sequence .##." } */
+
+  cdiag ("#1 priority");              /* { dg-warning "spurious leading punctuation sequence .#." } */
+  cdiag ("priority #2");
+
+  /* Quoting.  */
+  cdiag ("\"quoted\"");
+  cdiag ("\"quoted\" string");
+  cdiag ("this is a \"string in quotes\"");
+  cdiag ("\"missing closing quote");  /* { dg-warning "unterminated quote character '\"'" } */
+
+  /* PR translation/90121 - punctuation character after a space.  */
+  cdiag ("bad version : 1");          /* { dg-warning "space followed by punctuation character ':'" } */
+  cdiag ("problem ; fix it");         /* { dg-warning "space followed by punctuation character ';'" } */
+  cdiag ("End . not.");               /* { dg-warning "space followed by punctuation character '.'" } */
+  cdiag ("it is bad , very bad");     /* { dg-warning "space followed by punctuation character ','" } */
+  cdiag ("say what ?");               /* { dg-warning "space followed by punctuation character '?'" } */
+
+  /* But these are okay after a space.  But should they be?  */
+  cdiag ("1 / 2");
+  cdiag ("2 + 3");
+  cdiag ("2 - 3");
+}
+
+void test_cdiag_punct_balance (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  /* Less-than and greater than.  */
+  cdiag ("a < b");          /* { dg-warning "unbalanced punctuation character '<' in format" } */
+  cdiag ("must be > 0");    /* { dg-warning "unbalanced punctuation character '>' in format" } */
+
+  cdiag ("f()");            /* { dg-warning "spurious trailing punctuation sequence .\\\(\\\)." } */
+  cdiag ("g(1)");
+  cdiag ("(");              /* { dg-warning "spurious leading punctuation character|unbalanced" } */
+  cdiag ("()");             /* { dg-warning "spurious leading punctuation sequence" } */
+  cdiag (")");              /* { dg-warning "unbalanced punctuation character '\\\)'" } */
+  cdiag ("f()g");           /* { dg-warning "unquoted sequence of 2 consecutive punctuation characters" } */
+  cdiag ("illegal operand (1)");
+}
+
+
+void test_cdiag_nongraph (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("a\376b");         /* { dg-warning "unquoted non-graph character '\\\\xfe'" } */
+  cdiag ("a\377b");         /* { dg-warning "unquoted non-graph character '\\\\xff'" } */
+}
+
+
+void test_cdiag_attribute (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("attribute foo");
+  cdiag ("this is attribute bar");
+  cdiag ("bad __attribute bar");        /* { dg-warning "unquoted attribute" } */
+  cdiag ("__attribute__ (foobar) bad"); /* { dg-warning "unquoted attribute" } */
+  cdiag ("__attribute__ ((foobar))");   /* { dg-warning "unquoted attribute" } */
+  cdiag ("__attribute__ (xxx))");       /* { dg-warning "unquoted attribute" } */
+  /* { dg-warning "unbalanced punctuation character '\\\)'" "xxx" { target *-*-* } .-1 } */
+  cdiag ("__attribute__ ((yyy)))");     /* { dg-warning "unquoted attribute" } */
+  /* { dg-warning "unbalanced punctuation character '\\\)'" "yyy" { target *-*-* } .-1 } */
+  cdiag ("__attribute__ ((zzz)");       /* { dg-warning "unquoted attribute" } */
+  /* { dg-warning "unbalanced punctuation character '\\\('" "zzz" { target *-*-* } .-1 } */
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+
+  /* Verify that the warning can be suppressed.  */
+  cdiag ("__attribute__ (((");
+
+#pragma GCC diagnostic pop
+}
+
+void test_cdiag_builtin (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("__builtin_abort");    /* { dg-warning "unquoted name of built-in function '__builtin_abort'" } */
+  cdiag ("in __builtin_trap");  /* { dg-warning "unquoted name of built-in function '__builtin_trap'" } */
+  cdiag ("__builtin_xyz bites");/* { dg-warning "unquoted name of built-in function '__builtin_xyz'" } */
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+
+  /* Verify that the warning can be suppressed.  */
+  cdiag ("__builtin____with____lots__of__underscores");
+
+#pragma GCC diagnostic pop
+}
+
+
+void test_cdiag_option (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("%<-Wall%>");
+  cdiag ("use option %<-Wextra%> to enable additinal warnings");
+
+  cdiag ("-O2 is fast");        /* { dg-warning "unquoted option name '-O2'" } */
+  cdiag ("but -O3 is faster");  /* { dg-warning "unquoted option name '-O3'" } */
+
+  cdiag ("get --help");         /* { dg-warning "unquoted option name '--help'" } */
+  cdiag ("enable -m32");        /* { dg-warning "unquoted option name '-m32'" } */
+  cdiag ("value is -12");
+  cdiag ("foo-O2");
+  cdiag ("a-W");
+}
+
+
+void test_cdiag_keyword (tree t, gimple *gc)
+{
+  cdiag ("alignasi");
+  cdiag ("malignofer or alignofus");
+  cdiag ("use alignof");        /* { dg-warning "unquoted keyword 'alignof'" } */
+  cdiag ("or _Alignof");        /* { dg-warning " keyword '_Alignof'" } */
+  cdiag ("_Pragma too");        /* { dg-warning " keyword '_Pragma'" } */
+
+  cdiag ("a #error directive"); /* { dg-warning "unquoted preprocessing directive '#error'" } */
+  cdiag ("#include file");      /* { dg-warning "unquoted preprocessing directive '#include'" } */
+  cdiag ("but #pragma foobar"); /* { dg-warning "unquoted preprocessing directive '#pragma'" } */
+  cdiag ("pragma foobar is okay");
+  cdiag ("or even # pragma is fine");
+
+  /* Exercise qualifiers.  */
+  cdiag ("const function");
+  cdiag ("const-qualified variable"); /* { dg-warning "unquoted keyword 'const-qualified'" } */
+  /* { dg-message "use '%<const%>-qualified' instead" "const-qualified" { target *-*-* } .-1 } */
+  cdiag ("a const %qD", t);     /* { dg-warning "unquoted keyword 'const'" } */
+  cdiag ("restrict %qE", t);    /* { dg-warning "unquoted keyword 'restrict'" } */
+  cdiag ("volatile %qT", t);    /* { dg-warning "unquoted keyword 'volatile'" } */
+  cdiag ("const %qD and restrict %qE or volatile %qT", t, t, t);
+  /* { dg-warning "unquoted keyword 'const'" "" { target *-*-* } .-1 } */
+  /* { dg-warning "unquoted keyword 'restrict'" "" { target *-*-* } .-2 } */
+  /* { dg-warning "unquoted keyword 'volatile'" "" { target *-*-* } .-3 } */
+
+  cdiag ("an offsetof here");   /* { dg-warning "unquoted keyword 'offsetof" } */
+  cdiag ("sizeof x");           /* { dg-warning "unquoted keyword 'sizeof" } */
+  cdiag ("have typeof");        /* { dg-warning "unquoted keyword 'typeof" } */
+
+  /* Words that are not keywords are so are not expected to be quoted.  */
+  cdiag ("break rules");
+  cdiag ("if we continue by default for a short while else do nothing");
+  cdiag ("register a function for unsigned extern to void const reads");
+  cdiag ("or volatile access");
+}
+
+
+void test_cdiag_operator (tree t, gimple *gc)
+{
+  cdiag ("x != 0");             /* { dg-warning "unquoted operator '!='" } */
+  cdiag ("logical &&");         /* { dg-warning "unquoted operator '&&" } */
+  cdiag ("+= operator");        /* { dg-warning "unquoted operator '\\\+=" } */
+  cdiag ("a == b");             /* { dg-warning "unquoted operator '=='" } */
+  cdiag ("++a");                /* { dg-warning "unquoted operator '\\\+\\\+'" } */
+  cdiag ("b--");                /* { dg-warning "unquoted operator '--'" } */
+  cdiag ("1 << 2");             /* { dg-warning "unquoted operator '<<'" } */
+  cdiag (">> here <<");         /* { dg-warning "unquoted operator '>>|<<'" } */
+}
+
+
+void test_cdiag_type_name (tree t, gimple *gc)
+{
+  cdiag ("the word character should not be quoted");
+  cdiag ("but char should be"); /* { dg-warning "unquoted keyword 'char'" } */
+
+  cdiag ("unsigned char should be quoted");     /* { dg-warning "unquoted type name 'unsigned char'" } */
+  cdiag ("but unsigned character is fine");
+
+  cdiag ("as should int");      /* { dg-warning "unquoted keyword 'int'" } */
+  cdiag ("and signed int");     /* { dg-warning "unquoted type name 'signed int'" } */
+  cdiag ("and also unsigned int");     /* { dg-warning "unquoted type name 'unsigned int'" } */
+  cdiag ("very long thing");
+  cdiag ("use long long here"); /* { dg-warning "unquoted type name 'long long'" } */
+
+  cdiag ("have a floating type");
+  cdiag ("found float type");   /* { dg-warning "unquoted keyword 'float'" } */
+
+  cdiag ("wchar_t is wide");    /* { dg-warning "unquoted identifier or keyword 'wchar_t'" } */
+}
+
+
+void test_cdiag_identifier (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("private _x ident");   /* { dg-warning "unquoted identifier or keyword '_x'" } */
+  cdiag ("and another __y");    /* { dg-warning "unquoted identifier or keyword '__y'" } */
+  cdiag ("ident z_ with trailing underscore");   /* { dg-warning "unquoted identifier or keyword 'z_'" } */
+  cdiag ("v_ variable");        /* { dg-warning "unquoted identifier or keyword 'v_'" } */
+  cdiag ("call foo_bar");       /* { dg-warning "unquoted identifier or keyword 'foo_bar'" } */
+  cdiag ("unqoted x_y ident");  /* { dg-warning "unquoted identifier or keyword 'x_y'" } */
+
+  cdiag ("size_t type");        /* { dg-warning "unquoted identifier or keyword 'size_t'" } */
+  cdiag ("bigger than INT_MAX");/* { dg-warning "unquoted identifier or keyword 'INT_MAX'" } */
+
+  cdiag ("quoted ident %<a_b%>");
+  cdiag ("another quoted identifier %<x_%> here");
+}
+
+
+void test_cdiag_bad_words (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cdiag ("aren't you dumb?");  /* { dg-warning "bare apostrophe ''' in format" } */
+  cdiag ("bitfields suck");    /* { dg-warning "misspelled term 'bitfields' in format; use 'bit-fields' instead" } */
+  cdiag ("invalid bitfield");  /* { dg-warning "misspelled term 'bitfield' in format; use 'bit-field' instead" } */
+  cdiag ("bad builtin function");  /* { dg-warning "misspelled term 'builtin function' in format; use 'built-in function' instead" } */
+  cdiag ("bad builtin function");  /* { dg-warning "misspelled term 'builtin function' in format; use 'built-in function' instead" } */
+  cdiag ("builtin function x");    /* { dg-warning "misspelled term 'builtin function' in format; use 'built-in function' instead" } */
+  cdiag ("builtin functions disabled");    /* { dg-warning "misspelled term 'builtin functions' in format; use 'built-in functions' instead" } */
+  cdiag ("enable builtin functions");      /* { dg-warning "misspelled term 'builtin functions' in format; use 'built-in functions' instead" } */
+  cdiag ("you can't do that"); /* { dg-warning "contraction 'can't' in format" } */
+  cdiag ("you can%'t do that");/* { dg-warning "contraction 'can%'t' in format" } */
+  cdiag ("Can%'t touch this.");/* { dg-warning "contraction 'Can%'t' in format" } */
+  cdiag ("on the commandline");/* { dg-warning "misspelled term 'commandline' in format; use 'command line' instead" } */
+  cdiag ("command line option");/* { dg-warning "misspelled term 'command line option' in format; use 'command-line option' instead" } */
+  cdiag ("it mustn't be");     /* { dg-warning "contraction 'mustn't' in format" } */
+  cdiag ("isn't that silly?"); /* { dg-warning "bare apostrophe ''' in format" } */
+
+  cdiag ("can not do this");   /* { dg-warning "misspelled term 'can not' in format; use 'cannot' instead" } */
+  cdiag ("you can not");       /* { dg-warning "misspelled term 'can not' in format; use 'cannot' instead" } */
+
+  /* See PR target/90157 - aarch64: unnecessary abbreviation in diagnostic */
+  cdiag ("Mising arg.");       /* { dg-warning "misspelled term 'arg' in format; use 'argument' instead" } */
+  cdiag ("2 args: a and b");   /* { dg-warning "misspelled term 'args' in format; use 'arguments' instead" } */
+  cdiag ("arg 1");             /* { dg-warning "misspelled term 'arg' in format; use 'argument' instead" } */
+  cdiag ("Args are wrong.");   /* { dg-warning "misspelled term 'Args' in format; use 'arguments' instead" } */
+  cdiag ("bad arg");           /* { dg-warning "misspelled term 'arg' in format; use 'argument' instead" } */
+  cdiag ("two args");          /* { dg-warning "misspelled term 'args' in format; use 'arguments' instead" } */
+  cdiag ("args 1 and 2");      /* { dg-warning "misspelled term 'args' in format; use 'arguments' instead" } */
+
+  cdiag ("Reg A");             /* { dg-warning "misspelled term 'Reg' in format; use 'register' instead" } */
+  cdiag ("regs A and B");      /* { dg-warning "misspelled term 'regs' in format; use 'registers' instead" } */
+  cdiag ("no regs");           /* { dg-warning "misspelled term 'regs' in format; use 'registers' instead" } */
+
+  /* Verify words that end in "arg" and "args" or "reg" and "regs" are
+     not diagnosed.  */
+  cdiag ("gulmarg and balfarg");
+  cdiag ("ademargs or toshargs");
+  cdiag ("talk to Greg");
+  cdiag ("prepreg is a fabric");
+  cdiag ("there are dregs in my wine");
+}
+
+
+void test_cdiag_directive (tree t, gimple *gc)
+{
+  (void)&t; (void)&gc;
+
+  cxxdiag ("%<%s%>", "");     /* { dg-warning "quoted '%s' directive in format" } */
+  /* This was asked to be diagnosed in PR #90158 but there, the \"%s\"
+     is in parenheses which ends up getting diagnosed because of
+     the two consecutive punctuation characters, ( and ".  */
+  cdiag ("\"%s\"", "");       /* { dg-warning "quoted '%s' directive in format" } */
+
+  /* Make sure quoted paired tokens are not diagnosed.  */
+  cdiag ("%<'%>");
+  cdiag ("%<\"%>");
+  cdiag ("%<<%>");
+  cdiag ("%<>%>");
+  cdiag ("%<(%>");
+  cdiag ("%<)%>");
+  cdiag ("%<[%>");
+  cdiag ("%<]%>");
+
+  cdiag ("%<'%> %<\"%> %<>%> %<<%> %<)%> %<(%> %<]%> %<[%>");
+}
diff --git a/gcc/testsuite/gcc.dg/funroll-loops-all.c b/gcc/testsuite/gcc.dg/funroll-loops-all.c
index 9cdc9017255..ab12df1c431 100644
--- a/gcc/testsuite/gcc.dg/funroll-loops-all.c
+++ b/gcc/testsuite/gcc.dg/funroll-loops-all.c
@@ -1,4 +1,4 @@ 
 /* PR 17594 */
 /* { dg-do compile } */
 /* { dg-options "-funroll-loops-all" } */
-/* { dg-error "unrecognized command line option '-funroll-loops-all'" "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-funroll-loops-all'" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/misc-column.c b/gcc/testsuite/gcc.dg/misc-column.c
index e68300bfc29..c036060dd74 100644
--- a/gcc/testsuite/gcc.dg/misc-column.c
+++ b/gcc/testsuite/gcc.dg/misc-column.c
@@ -13,7 +13,7 @@  extern void bar();
 
 void foo (void)
 {
-  if (a == b) /* { dg-warning "9:comparing floating point with" } */
+  if (a == b) /* { dg-warning "9:comparing floating-point values with" } */
     bar ();
 
   if (p < q) /* { dg-warning "9:comparison of distinct pointer types" } */
diff --git a/gcc/testsuite/gcc.dg/opts-5.c b/gcc/testsuite/gcc.dg/opts-5.c
index ab1e6f91d3c..80bead84855 100644
--- a/gcc/testsuite/gcc.dg/opts-5.c
+++ b/gcc/testsuite/gcc.dg/opts-5.c
@@ -2,4 +2,4 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fstack-limit" } */
 
-/* { dg-error "unrecognized command line option" "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/pr28322-2.c b/gcc/testsuite/gcc.dg/pr28322-2.c
index 89dd15390f8..c9e5e228a7b 100644
--- a/gcc/testsuite/gcc.dg/pr28322-2.c
+++ b/gcc/testsuite/gcc.dg/pr28322-2.c
@@ -8,5 +8,5 @@  int foo (void)
   return i;
 }
 
-/* { dg-warning "unrecognized command line option .-Wno-foobar." "" { target *-*-* } 0 } */
+/* { dg-warning "unrecognized command-line option .-Wno-foobar." "" { target *-*-* } 0 } */
 
diff --git a/gcc/testsuite/gcc.dg/pr28322-3.c b/gcc/testsuite/gcc.dg/pr28322-3.c
index e714a3cc6f7..85926ade9e8 100644
--- a/gcc/testsuite/gcc.dg/pr28322-3.c
+++ b/gcc/testsuite/gcc.dg/pr28322-3.c
@@ -6,5 +6,5 @@  void foo(void)
 {
   int i =  1;
 }
-/* { dg-message "unrecognized command line option .-fno-foobar." "f" { target *-*-* } 0 } */
-/* { dg-message "unrecognized command line option .-mno-foobar." "m" { target *-*-* } 0 } */
+/* { dg-message "unrecognized command-line option .-fno-foobar." "f" { target *-*-* } 0 } */
+/* { dg-message "unrecognized command-line option .-mno-foobar." "m" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/pr60087.c b/gcc/testsuite/gcc.dg/pr60087.c
index c6cf7aa4607..b3bd811caea 100644
--- a/gcc/testsuite/gcc.dg/pr60087.c
+++ b/gcc/testsuite/gcc.dg/pr60087.c
@@ -7,8 +7,8 @@  foo (unsigned int ui, int i)
 {
   const unsigned char uc = 0;
   _Bool b;
-  b = 0 != ~uc; /* { dg-warning "9:promoted ~unsigned is always non-zero" } */
-  b = 2 != ~uc; /* { dg-warning "9:comparison of promoted ~unsigned with constant" } */
-  b = uc == ~uc; /* { dg-warning "10:comparison of promoted ~unsigned with unsigned" } */
+  b = 0 != ~uc; /* { dg-warning "9:promoted bitwise complement of an unsigned value is always nonzero" } */
+  b = 2 != ~uc; /* { dg-warning "9:comparison of promoted bitwise complement of an unsigned value with constant" } */
+  b = uc == ~uc; /* { dg-warning "10:comparison of promoted bitwise complement of an unsigned value with unsigned" } */
   b = i == ui; /* { dg-warning "9:comparison of integer expressions of different signedness" } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr78957.c b/gcc/testsuite/gcc.dg/pr78957.c
index 305023e1870..432211935b9 100644
--- a/gcc/testsuite/gcc.dg/pr78957.c
+++ b/gcc/testsuite/gcc.dg/pr78957.c
@@ -1,6 +1,6 @@ 
 /* PR driver/78957 */
 /* { dg-do compile } */
 /* { dg-options "-fno-sso-struct=none" } */
-/* { dg-error "unrecognized command line option" "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option" "" { target *-*-* } 0 } */
 
 int i;
diff --git a/gcc/testsuite/gcc.dg/pr8715.c b/gcc/testsuite/gcc.dg/pr8715.c
index e45e77c09f4..2878a48a4d3 100644
--- a/gcc/testsuite/gcc.dg/pr8715.c
+++ b/gcc/testsuite/gcc.dg/pr8715.c
@@ -7,7 +7,7 @@  int foo()
 {
   unsigned char b = '1';
 
-  bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */
+  bool x = ~b; /* { dg-warning "promoted bitwise complement of an unsigned value is always nonzero" } */
 
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/simd-2.c b/gcc/testsuite/gcc.dg/simd-2.c
index e5462390eff..d24e076218d 100644
--- a/gcc/testsuite/gcc.dg/simd-2.c
+++ b/gcc/testsuite/gcc.dg/simd-2.c
@@ -33,10 +33,10 @@  hanneke ()
   foo = a; /* { dg-error "incompatible types when assigning" } */
 
   /* Casted assignment between scalar and SIMD of same size.  */
-  foo = (typeof (foo)) foo2; /* { dg-error "aggregate value used where a floating point was expected" } */
+  foo = (typeof (foo)) foo2; /* { dg-error "aggregate value used where a floating-point was expected" } */
 
   /* Casted assignment between scalar and SIMD of different size.  */
-  foo1 = (typeof (foo1)) foo2; /* { dg-error "aggregate value used where a floating point was expected" } */
+  foo1 = (typeof (foo1)) foo2; /* { dg-error "aggregate value used where a floating-point was expected" } */
 
   /* Operators on compatible SIMD types.  */
   a += b + b;
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-1.c b/gcc/testsuite/gcc.dg/spellcheck-options-1.c
index cd5fdcacfdb..bebb494b6af 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-1.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-1.c
@@ -1,4 +1,4 @@ 
 /* { dg-do compile } */
 /* { dg-options "-Wcoercion" } */
-/* { dg-error "unrecognized command line option '-Wcoercion'; did you mean '-Wconversion'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-Wcoercion'; did you mean '-Wconversion'?"  "" { target *-*-* } 0 } */
 
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-10.c b/gcc/testsuite/gcc.dg/spellcheck-options-10.c
index 1957205593b..77c6b5494f5 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-10.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-10.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-fno-if-convert" } */
-/* { dg-error "unrecognized command line option .-fno-if-convert.; did you mean .-fno-if-conversion.?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option .-fno-if-convert.; did you mean .-fno-if-conversion.?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-12.c b/gcc/testsuite/gcc.dg/spellcheck-options-12.c
index b5e65e54a39..9fbd944bcaf 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-12.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-12.c
@@ -4,4 +4,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-fno-stack-protector-explicit" } */
-/* { dg-error "unrecognized command line option .-fno-stack-protector-explicit.; did you mean .-fstack-protector-explicit.." "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option .-fno-stack-protector-explicit.; did you mean .-fstack-protector-explicit.." "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-13.c b/gcc/testsuite/gcc.dg/spellcheck-options-13.c
index 0d00642d87e..94db0c5a458 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-13.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-13.c
@@ -2,4 +2,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-fsanitize" } */
-/* { dg-error "unrecognized command line option '-fsanitize'; did you mean '-fsanitize='?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-fsanitize'; did you mean '-fsanitize='?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-18.c b/gcc/testsuite/gcc.dg/spellcheck-options-18.c
index 387d04e3743..26694f945a8 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-18.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-18.c
@@ -1,3 +1,3 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fprofile-update" } */
-/* { dg-error "unrecognized command line option '-fprofile-update'; did you mean '-fprofile-update='?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-fprofile-update'; did you mean '-fprofile-update='?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-19.c b/gcc/testsuite/gcc.dg/spellcheck-options-19.c
index 5a104763993..68e85a71d77 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-19.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-19.c
@@ -1,3 +1,3 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fno-sanitize" } */
-/* { dg-error "unrecognized command line option '-fno-sanitize'; did you mean '-fno-sanitize='?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-fno-sanitize'; did you mean '-fno-sanitize='?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-2.c b/gcc/testsuite/gcc.dg/spellcheck-options-2.c
index 786266df390..5156ad3ef17 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-2.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
 /* { dg-options "-Wthis-should-not-get-a-hint" } */
 /* { dg-bogus "did you mean" "" { target *-*-* } 0 } */
-/* { dg-error "unrecognized command line option '-Wthis-should-not-get-a-hint'"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-Wthis-should-not-get-a-hint'"  "" { target *-*-* } 0 } */
 
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-20.c b/gcc/testsuite/gcc.dg/spellcheck-options-20.c
index dfc6149e023..d856d5a0810 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-20.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-20.c
@@ -1,3 +1,3 @@ 
 /* { dg-do compile } */
 /* { dg-options "-Walloc-size-larger-than" } */
-/* { dg-error "unrecognized command line option '-Walloc-size-larger-than'; did you mean '-Walloc-size-larger-than='?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-Walloc-size-larger-than'; did you mean '-Walloc-size-larger-than='?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-3.c b/gcc/testsuite/gcc.dg/spellcheck-options-3.c
index 4133df9555e..cecc50299bb 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-3.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-3.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-sanitize=address" } */
-/* { dg-error "unrecognized command line option '-sanitize=address'; did you mean '-fsanitize=address'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-sanitize=address'; did you mean '-fsanitize=address'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-4.c b/gcc/testsuite/gcc.dg/spellcheck-options-4.c
index 252376fd757..ab730edea93 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-4.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-4.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-sanitize-recover=integer-divide-by-0" } */
-/* { dg-error "unrecognized command line option '-sanitize-recover=integer-divide-by-0'; did you mean '-fsanitize-recover=integer-divide-by-zero'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-sanitize-recover=integer-divide-by-0'; did you mean '-fsanitize-recover=integer-divide-by-zero'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-5.c b/gcc/testsuite/gcc.dg/spellcheck-options-5.c
index 9a02bb7afbb..097faf0bce1 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-5.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-5.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-no-sanitize=all" } */
-/* { dg-error "unrecognized command line option '-no-sanitize=all'; did you mean '-fno-sanitize=all'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-no-sanitize=all'; did you mean '-fno-sanitize=all'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-6.c b/gcc/testsuite/gcc.dg/spellcheck-options-6.c
index 4d6bf0d945d..591e2146138 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-6.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-6.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-fwarn-no-abi-tag" } */
-/* { dg-error "unrecognized command line option '-fwarn-no-abi-tag'; did you mean '--warn-no-abi-tag'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-fwarn-no-abi-tag'; did you mean '--warn-no-abi-tag'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-7.c b/gcc/testsuite/gcc.dg/spellcheck-options-7.c
index ca893994983..277d7d46876 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-7.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-7.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-tls-model=global-dynamic" } */
-/* { dg-error "unrecognized command line option '-tls-model=global-dynamic'; did you mean '-ftls-model=global-dynamic'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-tls-model=global-dynamic'; did you mean '-ftls-model=global-dynamic'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-8.c b/gcc/testsuite/gcc.dg/spellcheck-options-8.c
index 2cc6c1ff1fe..43cd5ac31fa 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-8.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-8.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "--Wno-narrowing" } */
-/* { dg-error "unrecognized command line option '--Wno-narrowing'; did you mean '-Wno-narrowing'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '--Wno-narrowing'; did you mean '-Wno-narrowing'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-9.c b/gcc/testsuite/gcc.dg/spellcheck-options-9.c
index 768b6f8c2a9..509f9e5936b 100644
--- a/gcc/testsuite/gcc.dg/spellcheck-options-9.c
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-9.c
@@ -3,4 +3,4 @@ 
 
 /* { dg-do compile } */
 /* { dg-options "-fmo-unroll-loops" } */
-/* { dg-error "unrecognized command line option '-fmo-unroll-loops'; did you mean '-fno-unroll-loops'?"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-fmo-unroll-loops'; did you mean '-fno-unroll-loops'?"  "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
index a7f2ab20014..ccd61efbe1e 100644
--- a/gcc/testsuite/gcc.dg/warn-abs-1.c
+++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
@@ -34,9 +34,9 @@  tst_notint (float *pf, double *pd, _Complex double *pc)
 void
 tst_notfloat (int *pi, long *pl, complex double *pc)
 {
-  *pi = fabsf (*pi);  /* { dg-warning "using floating point absolute value function" } */
-  *pl = fabs (*pl);   /* { dg-warning "using floating point absolute value function" } */
-  *pc = fabs (*pc);   /* { dg-warning "using floating point absolute value function" } */
+  *pi = fabsf (*pi);  /* { dg-warning "using floating-point absolute value function" } */
+  *pl = fabs (*pl);   /* { dg-warning "using floating-point absolute value function" } */
+  *pc = fabs (*pc);   /* { dg-warning "using floating-point absolute value function" } */
 }
 
 void
diff --git a/gcc/testsuite/gcc.target/i386/spellcheck-options-5.c b/gcc/testsuite/gcc.target/i386/spellcheck-options-5.c
index 61946f6543c..f5b5d41c9f5 100644
--- a/gcc/testsuite/gcc.target/i386/spellcheck-options-5.c
+++ b/gcc/testsuite/gcc.target/i386/spellcheck-options-5.c
@@ -2,4 +2,4 @@ 
 
 /* { dg-do compile { target *-*-linux* *-*-gnu* } } */
 /* { dg-options "-mandroidX" } */
-/* { dg-error "unrecognized command line option '-mandroidX'; did you mean '-mandroid'"  "" { target *-*-* } 0 } */
+/* { dg-error "unrecognized command-line option '-mandroidX'; did you mean '-mandroid'"  "" { target *-*-* } 0 } */