public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/Wformat-diag-targets)] Fix -Wformat-diag for s390x target.
@ 2022-01-12 10:29 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-01-12 10:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:018a5c20d406c3276d68b617eaac310d242e98d5

commit 018a5c20d406c3276d68b617eaac310d242e98d5
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Jan 12 09:28:02 2022 +0100

    Fix -Wformat-diag for s390x target.
    
    gcc/ChangeLog:
    
            * config/s390/s390-c.c (s390_expand_overloaded_builtin): Wrap
            keyword in quotes.
            (s390_resolve_overloaded_builtin): Remove trailing dot.
            * config/s390/s390.c (s390_const_operand_ok): Use - for range.
            (s390_expand_builtin): Remove trailing dot.
            (s390_emit_prologue): Likewise, use semicolon.
            (s390_option_override_internal): Update keyword.
            * varasm.c (do_assemble_alias): Wrap keyword in quotes.

Diff:
---
 gcc/config/s390/s390-c.c |  9 +++++----
 gcc/config/s390/s390.c   | 28 ++++++++++++++--------------
 gcc/varasm.c             |  2 +-
 3 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c
index 600018421df..603a5de6cce 100644
--- a/gcc/config/s390/s390-c.c
+++ b/gcc/config/s390/s390-c.c
@@ -484,7 +484,8 @@ s390_expand_overloaded_builtin (location_t loc,
     case S390_OVERLOADED_BUILTIN_s390_vec_step:
       if (TREE_CODE (TREE_TYPE ((*arglist)[0])) != VECTOR_TYPE)
 	{
-	  error_at (loc, "builtin vec_step can only be used on vector types.");
+	  error_at (loc, "builtin %qs can only be used on vector types",
+		    "vec_step");
 	  return error_mark_node;
 	}
       return build_int_cst (NULL_TREE,
@@ -905,7 +906,7 @@ s390_resolve_overloaded_builtin (location_t loc,
       if (ob_flags & B_INT)
 	{
 	  error_at (loc,
-		    "builtin %qF is for GCC internal use only.",
+		    "builtin %qF is for GCC internal use only",
 		    ob_fndecl);
 	  return error_mark_node;
 	}
@@ -913,7 +914,7 @@ s390_resolve_overloaded_builtin (location_t loc,
     }
 
   if (ob_flags & B_DEP)
-    warning_at (loc, 0, "builtin %qF is deprecated.", ob_fndecl);
+    warning_at (loc, 0, "builtin %qF is deprecated", ob_fndecl);
 
   if (!TARGET_VX && (ob_flags & B_VX))
     {
@@ -1021,7 +1022,7 @@ s390_resolve_overloaded_builtin (location_t loc,
     }
 
   if (bflags_overloaded_builtin_var[last_match_index] & B_DEP)
-    warning_at (loc, 0, "%qs matching variant is deprecated.",
+    warning_at (loc, 0, "%qs matching variant is deprecated",
 		IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
 
   /* Overloaded variants which have MAX set as low level builtin are
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 056002e4a4a..bf96cbf7588 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -766,7 +766,7 @@ s390_const_operand_ok (tree arg, int argnum, int op_flags, tree decl)
 		     argnum, decl, values);
 	    }
 	  else
-	    error ("constant argument %d for builtin %qF is out of range (0..%wu)",
+	    error ("constant argument %d for builtin %qF is out of range (0-%wu)",
 		   argnum, decl, (HOST_WIDE_INT_1U << bitwidth) - 1);
 
 	  return false;
@@ -783,7 +783,7 @@ s390_const_operand_ok (tree arg, int argnum, int op_flags, tree decl)
 	  || tree_to_shwi (arg) > ((HOST_WIDE_INT_1 << (bitwidth - 1)) - 1))
 	{
 	  error ("constant argument %d for builtin %qF is out of range "
-		 "(%wd..%wd)", argnum, decl,
+		 "(%wd-%wd)", argnum, decl,
 		 -(HOST_WIDE_INT_1 << (bitwidth - 1)),
 		 (HOST_WIDE_INT_1 << (bitwidth - 1)) - 1);
 	  return false;
@@ -832,25 +832,25 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
       if ((bflags & B_HTM) && !TARGET_HTM)
 	{
 	  error ("builtin %qF is not supported without %<-mhtm%> "
-		 "(default with %<-march=zEC12%> and higher).", fndecl);
+		 "(default with %<-march=zEC12%> and higher)", fndecl);
 	  return const0_rtx;
 	}
       if (((bflags & B_VX) || (bflags & B_VXE)) && !TARGET_VX)
 	{
 	  error ("builtin %qF requires %<-mvx%> "
-		 "(default with %<-march=z13%> and higher).", fndecl);
+		 "(default with %<-march=z13%> and higher)", fndecl);
 	  return const0_rtx;
 	}
 
       if ((bflags & B_VXE) && !TARGET_VXE)
 	{
-	  error ("Builtin %qF requires z14 or higher.", fndecl);
+	  error ("Builtin %qF requires z14 or higher", fndecl);
 	  return const0_rtx;
 	}
 
       if ((bflags & B_VXE2) && !TARGET_VXE2)
 	{
-	  error ("Builtin %qF requires z15 or higher.", fndecl);
+	  error ("Builtin %qF requires z15 or higher", fndecl);
 	  return const0_rtx;
 	}
 
@@ -11464,8 +11464,8 @@ s390_emit_prologue (void)
 	    {
 	      warning (0, "frame size of function %qs is %wd"
 		       " bytes exceeding user provided stack limit of "
-		       "%d bytes.  "
-		       "An unconditional trap is added.",
+		       "%d bytes; "
+		       "an unconditional trap is added",
 		       current_function_name(), cfun_frame_layout.frame_size,
 		       s390_stack_size);
 	      emit_insn (gen_trap ());
@@ -11479,9 +11479,9 @@ s390_emit_prologue (void)
 	      if (stack_guard >= s390_stack_size)
 		{
 		  warning (0, "frame size of function %qs is %wd"
-			   " bytes which is more than half the stack size. "
-			   "The dynamic check would not be reliable. "
-			   "No check emitted for this function.",
+			   " bytes which is more than half the stack size; "
+			   "the dynamic check would not be reliable; "
+			   "no check emitted for this function",
 			   current_function_name(),
 			   cfun_frame_layout.frame_size);
 		}
@@ -15557,11 +15557,11 @@ s390_option_override_internal (struct gcc_options *opts,
       if (TARGET_HARD_DFP_P (opts_set->x_target_flags))
 	{
 	  if (!TARGET_CPU_DFP_P (opts))
-	    error ("hardware decimal floating point instructions"
+	    error ("hardware decimal floating-point instructions"
 		   " not available on %s",
 		   processor_table[(int)opts->x_s390_arch].name);
 	  if (!TARGET_ZARCH_P (opts->x_target_flags))
-	    error ("hardware decimal floating point instructions"
+	    error ("hardware decimal floating-point instructions"
 		   " not available in ESA/390 mode");
 	}
       else
@@ -15573,7 +15573,7 @@ s390_option_override_internal (struct gcc_options *opts,
     {
       if (TARGET_HARD_DFP_P (opts_set->x_target_flags)
 	  && TARGET_HARD_DFP_P (opts->x_target_flags))
-	error ("%<-mhard-dfp%> can%'t be used in conjunction with "
+	error ("%<-mhard-dfp%> cannot be used in conjunction with "
 	       "%<-msoft-float%>");
 
       opts->x_target_flags &= ~MASK_HARD_DFP;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 76574be191f..0cbec5fd7fd 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6190,7 +6190,7 @@ do_assemble_alias (tree decl, tree target)
       if (!TARGET_SUPPORTS_WEAK)
 	{
 	  error_at (DECL_SOURCE_LOCATION (decl),
-		    "weakref is not supported in this configuration");
+		    "%qs is not supported in this configuration", "weakref ");
 	  return;
 	}
 #endif


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/marxin/heads/Wformat-diag-targets)] Fix -Wformat-diag for s390x target.
@ 2022-01-12  8:46 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-01-12  8:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a0c60ff3f7398cfa1a4dbfc2e9a6eee89b0d3758

commit a0c60ff3f7398cfa1a4dbfc2e9a6eee89b0d3758
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Jan 12 09:28:02 2022 +0100

    Fix -Wformat-diag for s390x target.
    
    gcc/ChangeLog:
    
            * config/s390/s390-c.c (s390_expand_overloaded_builtin): Wrap
            keyword in quotes.
            (s390_resolve_overloaded_builtin): Remove trailing dot.
            * config/s390/s390.c (s390_const_operand_ok): Use - for range.
            (s390_expand_builtin): Remove trailing dot.
            (s390_emit_prologue): Likewise, use semicolon.
            (s390_option_override_internal): Update keyword.
            * varasm.c (do_assemble_alias): Wrap keyword in quotes.

Diff:
---
 gcc/config/s390/s390-c.c |  9 +++++----
 gcc/config/s390/s390.c   | 28 ++++++++++++++--------------
 gcc/varasm.c             |  2 +-
 3 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c
index 600018421df..10bc6ac8900 100644
--- a/gcc/config/s390/s390-c.c
+++ b/gcc/config/s390/s390-c.c
@@ -484,7 +484,8 @@ s390_expand_overloaded_builtin (location_t loc,
     case S390_OVERLOADED_BUILTIN_s390_vec_step:
       if (TREE_CODE (TREE_TYPE ((*arglist)[0])) != VECTOR_TYPE)
 	{
-	  error_at (loc, "builtin vec_step can only be used on vector types.");
+	  error_at (loc, "builtin %qs can only be used on vector types",
+		    "vec_step ");
 	  return error_mark_node;
 	}
       return build_int_cst (NULL_TREE,
@@ -905,7 +906,7 @@ s390_resolve_overloaded_builtin (location_t loc,
       if (ob_flags & B_INT)
 	{
 	  error_at (loc,
-		    "builtin %qF is for GCC internal use only.",
+		    "builtin %qF is for GCC internal use only",
 		    ob_fndecl);
 	  return error_mark_node;
 	}
@@ -913,7 +914,7 @@ s390_resolve_overloaded_builtin (location_t loc,
     }
 
   if (ob_flags & B_DEP)
-    warning_at (loc, 0, "builtin %qF is deprecated.", ob_fndecl);
+    warning_at (loc, 0, "builtin %qF is deprecated", ob_fndecl);
 
   if (!TARGET_VX && (ob_flags & B_VX))
     {
@@ -1021,7 +1022,7 @@ s390_resolve_overloaded_builtin (location_t loc,
     }
 
   if (bflags_overloaded_builtin_var[last_match_index] & B_DEP)
-    warning_at (loc, 0, "%qs matching variant is deprecated.",
+    warning_at (loc, 0, "%qs matching variant is deprecated",
 		IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
 
   /* Overloaded variants which have MAX set as low level builtin are
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 056002e4a4a..bf96cbf7588 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -766,7 +766,7 @@ s390_const_operand_ok (tree arg, int argnum, int op_flags, tree decl)
 		     argnum, decl, values);
 	    }
 	  else
-	    error ("constant argument %d for builtin %qF is out of range (0..%wu)",
+	    error ("constant argument %d for builtin %qF is out of range (0-%wu)",
 		   argnum, decl, (HOST_WIDE_INT_1U << bitwidth) - 1);
 
 	  return false;
@@ -783,7 +783,7 @@ s390_const_operand_ok (tree arg, int argnum, int op_flags, tree decl)
 	  || tree_to_shwi (arg) > ((HOST_WIDE_INT_1 << (bitwidth - 1)) - 1))
 	{
 	  error ("constant argument %d for builtin %qF is out of range "
-		 "(%wd..%wd)", argnum, decl,
+		 "(%wd-%wd)", argnum, decl,
 		 -(HOST_WIDE_INT_1 << (bitwidth - 1)),
 		 (HOST_WIDE_INT_1 << (bitwidth - 1)) - 1);
 	  return false;
@@ -832,25 +832,25 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
       if ((bflags & B_HTM) && !TARGET_HTM)
 	{
 	  error ("builtin %qF is not supported without %<-mhtm%> "
-		 "(default with %<-march=zEC12%> and higher).", fndecl);
+		 "(default with %<-march=zEC12%> and higher)", fndecl);
 	  return const0_rtx;
 	}
       if (((bflags & B_VX) || (bflags & B_VXE)) && !TARGET_VX)
 	{
 	  error ("builtin %qF requires %<-mvx%> "
-		 "(default with %<-march=z13%> and higher).", fndecl);
+		 "(default with %<-march=z13%> and higher)", fndecl);
 	  return const0_rtx;
 	}
 
       if ((bflags & B_VXE) && !TARGET_VXE)
 	{
-	  error ("Builtin %qF requires z14 or higher.", fndecl);
+	  error ("Builtin %qF requires z14 or higher", fndecl);
 	  return const0_rtx;
 	}
 
       if ((bflags & B_VXE2) && !TARGET_VXE2)
 	{
-	  error ("Builtin %qF requires z15 or higher.", fndecl);
+	  error ("Builtin %qF requires z15 or higher", fndecl);
 	  return const0_rtx;
 	}
 
@@ -11464,8 +11464,8 @@ s390_emit_prologue (void)
 	    {
 	      warning (0, "frame size of function %qs is %wd"
 		       " bytes exceeding user provided stack limit of "
-		       "%d bytes.  "
-		       "An unconditional trap is added.",
+		       "%d bytes; "
+		       "an unconditional trap is added",
 		       current_function_name(), cfun_frame_layout.frame_size,
 		       s390_stack_size);
 	      emit_insn (gen_trap ());
@@ -11479,9 +11479,9 @@ s390_emit_prologue (void)
 	      if (stack_guard >= s390_stack_size)
 		{
 		  warning (0, "frame size of function %qs is %wd"
-			   " bytes which is more than half the stack size. "
-			   "The dynamic check would not be reliable. "
-			   "No check emitted for this function.",
+			   " bytes which is more than half the stack size; "
+			   "the dynamic check would not be reliable; "
+			   "no check emitted for this function",
 			   current_function_name(),
 			   cfun_frame_layout.frame_size);
 		}
@@ -15557,11 +15557,11 @@ s390_option_override_internal (struct gcc_options *opts,
       if (TARGET_HARD_DFP_P (opts_set->x_target_flags))
 	{
 	  if (!TARGET_CPU_DFP_P (opts))
-	    error ("hardware decimal floating point instructions"
+	    error ("hardware decimal floating-point instructions"
 		   " not available on %s",
 		   processor_table[(int)opts->x_s390_arch].name);
 	  if (!TARGET_ZARCH_P (opts->x_target_flags))
-	    error ("hardware decimal floating point instructions"
+	    error ("hardware decimal floating-point instructions"
 		   " not available in ESA/390 mode");
 	}
       else
@@ -15573,7 +15573,7 @@ s390_option_override_internal (struct gcc_options *opts,
     {
       if (TARGET_HARD_DFP_P (opts_set->x_target_flags)
 	  && TARGET_HARD_DFP_P (opts->x_target_flags))
-	error ("%<-mhard-dfp%> can%'t be used in conjunction with "
+	error ("%<-mhard-dfp%> cannot be used in conjunction with "
 	       "%<-msoft-float%>");
 
       opts->x_target_flags &= ~MASK_HARD_DFP;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 76574be191f..0cbec5fd7fd 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6190,7 +6190,7 @@ do_assemble_alias (tree decl, tree target)
       if (!TARGET_SUPPORTS_WEAK)
 	{
 	  error_at (DECL_SOURCE_LOCATION (decl),
-		    "weakref is not supported in this configuration");
+		    "%qs is not supported in this configuration", "weakref ");
 	  return;
 	}
 #endif


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-12 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 10:29 [gcc(refs/users/marxin/heads/Wformat-diag-targets)] Fix -Wformat-diag for s390x target Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2022-01-12  8:46 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).