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.
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;
/* { 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 } */