public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] riscv: Fix bootstrap [PR109384]
@ 2023-04-04  9:01 Jakub Jelinek
  2023-04-04  9:18 ` Kito Cheng
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2023-04-04  9:01 UTC (permalink / raw)
  To: Kito Cheng, Jeff Law; +Cc: gcc-patches

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


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

end of thread, other threads:[~2023-04-04  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04  9:01 [PATCH] riscv: Fix bootstrap [PR109384] Jakub Jelinek
2023-04-04  9:18 ` Kito Cheng

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).