On Tue, Jul 20, 2021 at 10:17:08AM -0500, Segher Boessenkool wrote:
> On Tue, Jul 20, 2021 at 05:01:00PM +0200, Jakub Jelinek wrote:
> > On Tue, Jul 20, 2021 at 09:48:26AM -0500, Segher Boessenkool wrote:
> > > > --- gcc/testsuite/gcc.dg/pr101384.c.jj  2021-07-13 13:45:42.971992584 
> > > > +0200
> > > > +++ gcc/testsuite/gcc.dg/pr101384.c     2021-07-13 13:45:32.427135184 
> > > > +0200
> > > > @@ -0,0 +1,39 @@
> > > > +/* PR target/101384 */
> > > > +/* { dg-do run } */
> > > > +/* { dg-options "-O2 -Wno-psabi -w" } */
> > > 
> > > If you have -w anyway, do you / why do you still need -Wno-psabi?
> > 
> > I think not all of the -Wpsabi diagnostics is emitted with warning{,_at}
> > etc. that -w disables, others are emitted with inform.
> 
> /* An informative note at LOCATION.  Use this for additional details on an 
> error
>    message.  */
> void
> inform (location_t location, const char *gmsgid, ...)
> 
> So inform is misused in -Wpsabi?

I bet it is done intentionally not to trigger -Werror, e.g. i386.c uses it
for the notes that some old GCC version had different ABI for certain
passing than the current one.

> If using it like this is deemed correct, then inhibit_warnings should
> turn it off just like it turns off all *stronger* warnings.  The current
> situation doesn't make much sense.
> 
> > The -Wno-psabi
> > also makes it clear that it is the psabi stuff that is what the testcase
> > cares about.  Whether -w is also needed or not is something I don't know,
> > in the past it certainly was needed on various architectures, but maybe it
> > got fixed and only -Wno-psabi would do the trick?
> > If so, perhaps we could replace all -Wno-psabi -w occurrences in testsuite
> > dg-options with just -Wno-psabi and see how far we get.
> > find testsuite/ -type f | xargs grep -- '-w -Wno-psabi' 2>/dev/null | grep 
> > -v ChangeLog | wc -l
> > 49
> > find testsuite/ -type f | xargs grep -- '-Wno-psabi -w' 2>/dev/null | grep 
> > -v ChangeLog | wc -l
> > 24
> 
> Note we will disable the -Wpsabi vector warnings for rs6000 from GCC 12
> on.  It should have been done earlier, but we need a time machine to
> install a time machine in the past, etc. :-)

I could understand dropping -Wpsabi warnings of the kind that some very old
GCC version had different ABI if sufficient number of releases passed since
then, but at least x86 also has -Wpsabi warnings that returning a certain
vector or taking certain vector as parameter has different ABI without
some particular ISA option.  And those options are valid all the time and
something people should be aware, e.g. returning 16-byte vector without
-msse, or 32-byte vector without -mavx, or 64-byte vector without -mavx512f
- without those ISA switches they are passed/returned as generic vectors,
while with that option in vector registers.

        Jakub

Reply via email to