public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/fix-Wformat-diag-with-rtl-checking)] Fix -Werror=format-diag with RTL checking
@ 2022-01-20  8:33 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-01-20  8:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:97c0a101e8017b36ff8364514a2a3b641f849d43

commit 97c0a101e8017b36ff8364514a2a3b641f849d43
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Jan 20 09:28:42 2022 +0100

    Fix -Werror=format-diag with RTL checking
    
            PR bootstrap/104135
    
    gcc/ChangeLog:
    
            * emit-rtl.cc (make_insn_raw): Fix -Wformat-diag warnings.
            * rtl.cc: Partially disable -Wformat-diag for RTL checking
            error messages.

Diff:
---
 gcc/emit-rtl.cc |  2 +-
 gcc/rtl.cc      | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index 3260ca8c3fa..a26bcb0fa2d 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -3997,7 +3997,7 @@ make_insn_raw (rtx pattern)
 	  || (GET_CODE (insn) == SET
 	      && SET_DEST (insn) == pc_rtx)))
     {
-      warning (0, "ICE: emit_insn used where emit_jump_insn needed:\n");
+      warning (0, "ICE: %<emit_insn%> used where %<emit_jump_insn%> needed:");
       debug_rtx (insn);
     }
 #endif
diff --git a/gcc/rtl.cc b/gcc/rtl.cc
index 02dd2554728..f3d85814014 100644
--- a/gcc/rtl.cc
+++ b/gcc/rtl.cc
@@ -870,6 +870,12 @@ dump_rtx_statistics (void)
 }
 \f
 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
+
+#if __GNUC__ >= 10
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
 void
 rtl_check_failed_bounds (const_rtx r, int n, const char *file, int line,
 			 const char *func)
@@ -945,6 +951,10 @@ rtl_check_failed_code_mode (const_rtx r, enum rtx_code code, machine_mode mode,
 		  func, trim_filename (file), line);
 }
 
+#if __GNUC__ >= 10
+#pragma GCC diagnostic pop
+#endif
+
 /* Report that line LINE of FILE tried to access the block symbol fields
    of a non-block symbol.  FUNC is the function that contains the line.  */


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

* [gcc(refs/users/marxin/heads/fix-Wformat-diag-with-rtl-checking)] Fix -Werror=format-diag with RTL checking
@ 2022-01-20  8:30 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-01-20  8:30 UTC (permalink / raw)
  To: gcc-cvs

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

commit f6c9a8a987e7eae1ac7458c535d7246a9ad6b51b
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Jan 20 09:28:42 2022 +0100

    Fix -Werror=format-diag with RTL checking
    
    gcc/ChangeLog:
    
            * emit-rtl.cc (make_insn_raw): Fix -Wformat-diag warnings.
            * rtl.cc: Partially disable -Wformat-diag for RTL checking
            error messages.

Diff:
---
 gcc/emit-rtl.cc |  2 +-
 gcc/rtl.cc      | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index 3260ca8c3fa..a26bcb0fa2d 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -3997,7 +3997,7 @@ make_insn_raw (rtx pattern)
 	  || (GET_CODE (insn) == SET
 	      && SET_DEST (insn) == pc_rtx)))
     {
-      warning (0, "ICE: emit_insn used where emit_jump_insn needed:\n");
+      warning (0, "ICE: %<emit_insn%> used where %<emit_jump_insn%> needed:");
       debug_rtx (insn);
     }
 #endif
diff --git a/gcc/rtl.cc b/gcc/rtl.cc
index 02dd2554728..f3d85814014 100644
--- a/gcc/rtl.cc
+++ b/gcc/rtl.cc
@@ -870,6 +870,12 @@ dump_rtx_statistics (void)
 }
 \f
 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
+
+#if __GNUC__ >= 10
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
 void
 rtl_check_failed_bounds (const_rtx r, int n, const char *file, int line,
 			 const char *func)
@@ -945,6 +951,10 @@ rtl_check_failed_code_mode (const_rtx r, enum rtx_code code, machine_mode mode,
 		  func, trim_filename (file), line);
 }
 
+#if __GNUC__ >= 10
+#pragma GCC diagnostic pop
+#endif
+
 /* Report that line LINE of FILE tried to access the block symbol fields
    of a non-block symbol.  FUNC is the function that contains the line.  */


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

end of thread, other threads:[~2022-01-20  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20  8:33 [gcc(refs/users/marxin/heads/fix-Wformat-diag-with-rtl-checking)] Fix -Werror=format-diag with RTL checking Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2022-01-20  8:30 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).