public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6759] Fix -Werror=format-diag with RTL checking
Date: Thu, 20 Jan 2022 11:03:14 +0000 (GMT)	[thread overview]
Message-ID: <20220120110314.E4ADC3858D35@sourceware.org> (raw)

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

commit r12-6759-ge744aa373d215d1e8b3f4102a71b26b385dababc
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      | 13 +++++++++++++
 2 files changed, 14 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..f17474bfee1 100644
--- a/gcc/rtl.cc
+++ b/gcc/rtl.cc
@@ -870,6 +870,15 @@ dump_rtx_statistics (void)
 }
 \f
 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
+
+/* Disable warnings about missing quoting in GCC diagnostics for
+   the internal_error calls.  Their format strings deliberately don't
+   follow GCC diagnostic conventions.  */
+#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 +954,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.  */


                 reply	other threads:[~2022-01-20 11:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220120110314.E4ADC3858D35@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).