[11/12] fix diagnostic quoting/spelling issues in i386 back-end

Message ID 50e6af79-64bd-a660-f101-7f7da1aad6b6@gmail.com
State New
Headers show
Series
  • detect quoting and punctuation problems in diagnostics
Related show

Commit Message

Martin Sebor May 14, 2019, 9:33 p.m.
The attached patch fixes quoting, spelling, and other formatting
issues in diagnostics issued by the i386 back-end and pointed out
by the -Wformat-diag warning.

Martin

Comments

Jeff Law May 16, 2019, 7:18 p.m. | #1
On 5/14/19 3:33 PM, Martin Sebor wrote:
> The attached patch fixes quoting, spelling, and other formatting

> issues in diagnostics issued by the i386 back-end and pointed out

> by the -Wformat-diag warning.

> 

> Martin

> 

> gcc-wformat-diag-i386.diff

> 

> gcc/ChangeLog:

> 

> 	* config/i386/i386-expand.c (get_element_number): Quote keywords

> 	and other internal names in diagnostics.  Adjust other diagnostic

> 	formatting issues noted by -Wformat-diag.

> 	* config/i386/i386-features.c

> 	(ix86_mangle_function_version_assembler_name): Same.

> 	* config/i386/i386-options.c (ix86_handle_abi_attribute): Same.

> 	* config/i386/i386.c (ix86_function_type_abi): Same.

> 	(ix86_function_ms_hook_prologue): Same.

> 	(classify_argument): Same.

> 	(ix86_expand_prologue): Same.

> 	(ix86_md_asm_adjust): Same.

> 	(ix86_memmodel_check): Same.

OK
jeff

Patch

gcc/ChangeLog:

	* config/i386/i386-expand.c (get_element_number): Quote keywords
	and other internal names in diagnostics.  Adjust other diagnostic
	formatting issues noted by -Wformat-diag.
	* config/i386/i386-features.c
	(ix86_mangle_function_version_assembler_name): Same.
	* config/i386/i386-options.c (ix86_handle_abi_attribute): Same.
	* config/i386/i386.c (ix86_function_type_abi): Same.
	(ix86_function_ms_hook_prologue): Same.
	(classify_argument): Same.
	(ix86_expand_prologue): Same.
	(ix86_md_asm_adjust): Same.
	(ix86_memmodel_check): Same.

diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index a55d4923be4..f96f079ee30 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -10630,7 +10630,8 @@  get_element_number (tree vec_type, tree arg)
   if (!tree_fits_uhwi_p (arg)
       || (elt = tree_to_uhwi (arg), elt > max))
     {
-      error ("selector must be an integer constant in the range 0..%wi", max);
+      error ("selector must be an integer constant in the range "
+	     "[0, %wi]", max);
       return 0;
     }
 
diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c
index 67f45d66c48..60a120f4df7 100644
--- a/gcc/config/i386/i386-features.c
+++ b/gcc/config/i386/i386-features.c
@@ -2447,7 +2447,7 @@  ix86_mangle_function_version_assembler_name (tree decl, tree id)
       && lookup_attribute ("gnu_inline",
 			   DECL_ATTRIBUTES (decl)))
     error_at (DECL_SOURCE_LOCATION (decl),
-	      "function versions cannot be marked as gnu_inline,"
+	      "function versions cannot be marked as %<gnu_inline%>,"
 	      " bodies have to be generated");
 
   if (DECL_VIRTUAL_P (decl)
diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
index dec8352143c..7c8ddbee0f7 100644
--- a/gcc/config/i386/i386-options.c
+++ b/gcc/config/i386/i386-options.c
@@ -3462,7 +3462,8 @@  ix86_handle_abi_attribute (tree *node, tree name, tree, int,
     {
       if (lookup_attribute ("sysv_abi", TYPE_ATTRIBUTES (*node)))
         {
-	  error ("ms_abi and sysv_abi attributes are not compatible");
+	  error ("%qs and %qs attributes are not compatible",
+		 "ms_abi", "sysv_abi");
 	}
 
       return NULL_TREE;
@@ -3471,7 +3472,8 @@  ix86_handle_abi_attribute (tree *node, tree name, tree, int,
     {
       if (lookup_attribute ("ms_abi", TYPE_ATTRIBUTES (*node)))
         {
-	  error ("ms_abi and sysv_abi attributes are not compatible");
+	  error ("%qs and %qs attributes are not compatible",
+		 "ms_abi", "sysv_abi");
 	}
 
       return NULL_TREE;
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index cc0ae3fcfd3..93ed940eb9e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1525,7 +1525,7 @@  ix86_function_type_abi (const_tree fntype)
       static int warned;
       if (TARGET_X32 && !warned)
 	{
-	  error ("X32 does not support ms_abi attribute");
+	  error ("X32 does not support %<ms_abi%> attribute");
 	  warned = 1;
 	}
 
@@ -1559,7 +1559,8 @@  ix86_function_ms_hook_prologue (const_tree fn)
     {
       if (decl_function_context (fn) != NULL_TREE)
 	error_at (DECL_SOURCE_LOCATION (fn),
-		  "ms_hook_prologue is not compatible with nested function");
+		  "%<ms_hook_prologue%> attribute is not compatible "
+		  "with nested function");
       else
         return true;
     }
@@ -2266,7 +2267,7 @@  classify_argument (machine_mode mode, const_tree type,
 		{
 		  warned = true;
 		  inform (input_location,
-			  "the ABI of passing union with long double"
+			  "the ABI of passing union with %<long double%>"
 			  " has changed in GCC 4.4");
 		}
 	      return 0;
@@ -2384,7 +2385,7 @@  classify_argument (machine_mode mode, const_tree type,
 	    {
 	      warned = true;
 	      inform (input_location,
-		      "the ABI of passing structure with complex float"
+		      "the ABI of passing structure with %<complex float%>"
 		      " member has changed in GCC 4.4");
 	    }
 	  classes[1] = X86_64_SSESF_CLASS;
@@ -7787,7 +7788,7 @@  ix86_expand_prologue (void)
       /* Check if profiling is active and we shall use profiling before
          prologue variant. If so sorry.  */
       if (crtl->profile && flag_fentry != 0)
-        sorry ("ms_hook_prologue attribute isn%'t compatible "
+        sorry ("%<ms_hook_prologue%> attribute is not compatible "
 	       "with %<-mfentry%> for 32-bit");
 
       /* In ix86_asm_output_function_label we emitted:
@@ -20651,7 +20652,7 @@  ix86_md_asm_adjust (vec<rtx> &outputs, vec<rtx> &/*inputs*/,
       con += 4;
       if (strchr (con, ',') != NULL)
 	{
-	  error ("alternatives not allowed in asm flag output");
+	  error ("alternatives not allowed in %<asm%> flag output");
 	  continue;
 	}
 
@@ -20715,7 +20716,7 @@  ix86_md_asm_adjust (vec<rtx> &outputs, vec<rtx> &/*inputs*/,
 	}
       if (code == UNKNOWN)
 	{
-	  error ("unknown asm flag output %qs", constraints[i]);
+	  error ("unknown %<asm%> flag output %qs", constraints[i]);
 	  continue;
 	}
       if (invert)
@@ -20744,7 +20745,7 @@  ix86_md_asm_adjust (vec<rtx> &outputs, vec<rtx> &/*inputs*/,
       machine_mode dest_mode = GET_MODE (dest);
       if (!SCALAR_INT_MODE_P (dest_mode))
 	{
-	  error ("invalid type for asm flag output");
+	  error ("invalid type for %<asm%> flag output");
 	  continue;
 	}
 
@@ -21678,13 +21679,15 @@  ix86_memmodel_check (unsigned HOST_WIDE_INT val)
   if (val & IX86_HLE_ACQUIRE && !(is_mm_acquire (model) || strong))
     {
       warning (OPT_Winvalid_memory_model,
-              "HLE_ACQUIRE not used with ACQUIRE or stronger memory model");
+              "%<HLE_ACQUIRE%> not used with %<ACQUIRE%> or stronger "
+	       "memory model");
       return MEMMODEL_SEQ_CST | IX86_HLE_ACQUIRE;
     }
   if (val & IX86_HLE_RELEASE && !(is_mm_release (model) || strong))
     {
       warning (OPT_Winvalid_memory_model,
-              "HLE_RELEASE not used with RELEASE or stronger memory model");
+              "%<HLE_RELEASE%> not used with %<RELEASE%> or stronger "
+	       "memory model");
       return MEMMODEL_SEQ_CST | IX86_HLE_RELEASE;
     }
   return val;