public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Kito Cheng <kito.cheng@gmail.com>, Jeff Law <jeffreyalaw@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH] riscv: Fix bootstrap [PR109384]
Date: Tue, 4 Apr 2023 11:01:18 +0200	[thread overview]
Message-ID: <ZCvnXt00qMrZyJSM@tucnak> (raw)

Hi!

The following patch unbreaks riscv bootstrap, where it previously failed
on -Werror=format-diag warning promoted to error.

Ok for trunk?

Or shall it say e.g.
"%<-march=%s%>: %<zfinx%> extension conflicts with %<f>"
?
Or say if the current condition is true, do
const char *ext = "zfinx";
if (subset_list->lookup ("zdinx"))
  ext = "zdinx";
else if (subset_list->lookup ("zhinx"))
  ext = "zhinx";
else if (subset_list->lookup ("zhinxmin"))
  ext = "zhinxmin";
and
"%<-march=%s%>: %qs extension conflicts with %<f>", arch, ext
?  Or do similar check for which extension to print against it,
const char *ext = "zfinx";
const char *ext2 = "f";
if (subset_list->lookup ("zdinx"))
  {
    ext = "zdinx";
    if (subset_list->lookup ("d"))
      ext2 = "d";
  }
else if (subset_list->lookup ("zhinx"))
  {
    ext = "zhinx";
    if (subset_list->lookup ("zfh"))
      ext2 = "zfh";
  }
else if (subset_list->lookup ("zhinxmin"))
  {
    ext = "zhinxmin";
    if (subset_list->lookup ("zfhmin"))
      ext2 = "zfhmin";
  }
"%<-march=%s%>: %qs extension conflicts with %qs", arch, ext, ext2
?

2023-04-04  Jakub Jelinek  <jakub@redhat.com>

	PR target/109384
	* common/config/riscv/riscv-common.cc (riscv_subset_list::parse):
	Reword diagnostics about zfinx conflict with f, formatting fixes.

	* gcc.target/riscv/arch-19.c: Expect a different message about zfinx
	vs. f conflict.

--- gcc/common/config/riscv/riscv-common.cc.jj	2023-04-04 10:46:33.473871184 +0200
+++ gcc/common/config/riscv/riscv-common.cc	2023-04-04 10:41:22.014477456 +0200
@@ -1153,10 +1153,9 @@ riscv_subset_list::parse (const char *ar
 
   subset_list->handle_combine_ext ();
 
-  if (subset_list->lookup("zfinx") && subset_list->lookup("f"))
-	error_at (loc,
-	"%<-march=%s%>: z*inx is conflict with float extensions",
-	arch);
+  if (subset_list->lookup ("zfinx") && subset_list->lookup ("f"))
+    error_at (loc, "%<-march=%s%>: z*inx conflicts with floating-point "
+		   "extensions", arch);
 
   return subset_list;
 
--- gcc/testsuite/gcc.target/riscv/arch-19.c.jj	2023-03-29 22:37:11.465651690 +0200
+++ gcc/testsuite/gcc.target/riscv/arch-19.c	2023-04-04 10:45:50.734503089 +0200
@@ -1,4 +1,4 @@
 /* { dg-do compile } */
 /* { dg-options "-march=rv64if_zfinx -mabi=lp64" } */
 int foo() {}
-/* { dg-error "'-march=rv64if_zfinx': z\\*inx is conflict with float extensions" "" { target *-*-* } 0 } */
+/* { dg-error "'-march=rv64if_zfinx': z\\*inx conflicts with floating-point extensions" "" { target *-*-* } 0 } */

	Jakub


             reply	other threads:[~2023-04-04  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04  9:01 Jakub Jelinek [this message]
2023-04-04  9:18 ` Kito Cheng

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=ZCvnXt00qMrZyJSM@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    /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).