public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] riscv: Allow -Wno-psabi to turn off ABI warnings [PR91229]
@ 2022-03-15 10:56 Jakub Jelinek
  2022-03-15 12:30 ` Kito Cheng
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2022-03-15 10:56 UTC (permalink / raw)
  To: Kito Cheng, Palmer Dabbelt, Andrew Waterman, Jim Wilson; +Cc: gcc-patches

Hi!

While checking if all targets honor -Wno-psabi for ABI related warnings
or messages, I found that almost all do, except for riscv.
In the testsuite when we want to ignore ABI related messages we
typically use -Wno-psabi -w, but it would be nice to get rid of those
-w uses eventually.

The following allows silencing those warnings with -Wno-psabi rather than
just -w even on riscv.

Ok for trunk?

2022-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/91229
	* config/riscv/riscv.cc (riscv_pass_aggregate_in_fpr_pair_p,
	riscv_pass_aggregate_in_fpr_and_gpr_p): Pass OPT_Wpsabi instead of 0
	to warning calls.

--- gcc/config/riscv/riscv.cc.jj	2022-03-07 15:00:17.239592719 +0100
+++ gcc/config/riscv/riscv.cc	2022-03-15 11:20:37.823661044 +0100
@@ -2918,8 +2918,8 @@ riscv_pass_aggregate_in_fpr_pair_p (cons
 
   if ((n_old != n_new) && (warned == 0))
     {
-      warning (0, "ABI for flattened struct with zero-length bit-fields "
-	       "changed in GCC 10");
+      warning (OPT_Wpsabi, "ABI for flattened struct with zero-length "
+			   "bit-fields changed in GCC 10");
       warned = 1;
     }
 
@@ -2960,8 +2960,8 @@ riscv_pass_aggregate_in_fpr_and_gpr_p (c
 	   && (num_int_old != num_int_new || num_float_old != num_float_new)))
       && (warned == 0))
     {
-      warning (0, "ABI for flattened struct with zero-length bit-fields "
-	       "changed in GCC 10");
+      warning (OPT_Wpsabi, "ABI for flattened struct with zero-length "
+			   "bit-fields changed in GCC 10");
       warned = 1;
     }
 

	Jakub


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

* Re: [PATCH] riscv: Allow -Wno-psabi to turn off ABI warnings [PR91229]
  2022-03-15 10:56 [PATCH] riscv: Allow -Wno-psabi to turn off ABI warnings [PR91229] Jakub Jelinek
@ 2022-03-15 12:30 ` Kito Cheng
  0 siblings, 0 replies; 2+ messages in thread
From: Kito Cheng @ 2022-03-15 12:30 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Palmer Dabbelt, Andrew Waterman, Jim Wilson, GCC Patches

Hi Jakub:

LGTM, Thanks!

On Tue, Mar 15, 2022 at 6:57 PM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi!
>
> While checking if all targets honor -Wno-psabi for ABI related warnings
> or messages, I found that almost all do, except for riscv.
> In the testsuite when we want to ignore ABI related messages we
> typically use -Wno-psabi -w, but it would be nice to get rid of those
> -w uses eventually.
>
> The following allows silencing those warnings with -Wno-psabi rather than
> just -w even on riscv.
>
> Ok for trunk?
>
> 2022-03-15  Jakub Jelinek  <jakub@redhat.com>
>
>         PR target/91229
>         * config/riscv/riscv.cc (riscv_pass_aggregate_in_fpr_pair_p,
>         riscv_pass_aggregate_in_fpr_and_gpr_p): Pass OPT_Wpsabi instead of 0
>         to warning calls.
>
> --- gcc/config/riscv/riscv.cc.jj        2022-03-07 15:00:17.239592719 +0100
> +++ gcc/config/riscv/riscv.cc   2022-03-15 11:20:37.823661044 +0100
> @@ -2918,8 +2918,8 @@ riscv_pass_aggregate_in_fpr_pair_p (cons
>
>    if ((n_old != n_new) && (warned == 0))
>      {
> -      warning (0, "ABI for flattened struct with zero-length bit-fields "
> -              "changed in GCC 10");
> +      warning (OPT_Wpsabi, "ABI for flattened struct with zero-length "
> +                          "bit-fields changed in GCC 10");
>        warned = 1;
>      }
>
> @@ -2960,8 +2960,8 @@ riscv_pass_aggregate_in_fpr_and_gpr_p (c
>            && (num_int_old != num_int_new || num_float_old != num_float_new)))
>        && (warned == 0))
>      {
> -      warning (0, "ABI for flattened struct with zero-length bit-fields "
> -              "changed in GCC 10");
> +      warning (OPT_Wpsabi, "ABI for flattened struct with zero-length "
> +                          "bit-fields changed in GCC 10");
>        warned = 1;
>      }
>
>
>         Jakub
>

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

end of thread, other threads:[~2022-03-15 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15 10:56 [PATCH] riscv: Allow -Wno-psabi to turn off ABI warnings [PR91229] Jakub Jelinek
2022-03-15 12:30 ` 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).