Hi,

On Fri, Feb 26, 2016 at 05:46:33PM +0100, Thomas Schwinge wrote:
> Hi!
> 
> In light of the -Whsa testsuite patches just posted, I think we first
> need to clarify the general policy questions I posted a month ago:
> 
> On Tue, 26 Jan 2016 11:46:14 +0100, I wrote:
> > On Thu, 10 Dec 2015 18:51:48 +0100, Martin Jambor <mjam...@suse.cz> wrote:
> > > On Mon, Dec 07, 2015 at 12:46:45PM +0100, Jakub Jelinek wrote:
> > > > On Mon, Dec 07, 2015 at 12:17:58PM +0100, Martin Jambor wrote:
> > > > > [...]  There are no failing
> > > > > testcases if HSA is not configured.  If it is, there are some, all of
> > > > > which fall into one the following categories:
> > > > > 
> > > > >   1) HSA cannot compile a function for one reason or another (most
> > > > >      common cause is inability of HSA to take an address of a function
> > > > >      or make an indirect call) and gives a warning, which is regarded
> > > > >      as an "excess error" by dejagnu.
> > 
> > Confirmed:
> > 
> >     [...]/gcc/testsuite/c-c++-common/gomp/clauses-1.c: In function 
> > 'bar._omp_fn.26.hsa.31':
> >     cc1: warning: could not emit HSAIL for the function [-Whsa]
> >     cc1: note: support for HSA does not implement non-gridified OpenMP 
> > parallel constructs.
> >     [...]
> > 
> > ..., and many more.  So, with --enable-offload-targets=[...],hsa we
> > regress (PASS -> FAIL; "test for excess errors") such compile tests.
> > 
> > > > It would be good if there is a -W* switch to turn such warnings off.
> > > > Not just for the purposes of dejagnu libgomp testing, but say one
> > > > might try to compile a program primarily say for XeonPhi or PTX 
> > > > offloading,
> > > > but have HSA enabled to, but care primarily about the former two, etc.
> > > 
> > > All these warnings are in the -Whsa group and can be suppressed with
> > > -Wno-hsa.
> > 
> > These compile tests are done without any -W* flags; -Whsa is enabled by
> > default.
> 
> I'm a proponent of enabling as many useful warnings by default, or if not
> by default, then with -Wall.  -Whsa is enabled by default, and has thus
> set a precedent of doing that.

I am not sure I'd go as far as "as many as possible," but in the case
of -Whsa, the warnings get emitted only if HSA offloading is
configured and especially only if the user used OMP and its target
construct.  This means that it is relevant only for a rather small
class of users and it's not a "your code looks weird" kind of warning
but a "the compiler is not doing what you clearly asked for" warning.
So that is why we decided to warn unconditionally.

But as far as I understand, gcc does not give any promises about
warnings, so I believe decisions like a defaultness of a warning can
be revisited at any point in the future, for example if people learn
not to expect some constructs to be offloaded to GPUs.  Moreover, the
conventions regarding offloading are still being settled and still
will for quite some time so nobody should really expect such details
to be set in stone.

> 
> > How to address this mismatch?  Put -Wno-has into all regressing
> > test case files individually?  Run the affected testsuites with -Wno-hsa?
> > Not enable -Whsa by default (but I agree it's useful to users)?
> > (Instead, enable with -Wall, which any sane user should be specifying?)
> 
> Even if a bit tedious, my preference actually is to add to the test cases
> an (expected) dg-warning everywhere where such a non-offloading warning
> currently triggers, because that's what users will be seeing (with -Whsa
> enabled by default), and because that will make it obvious (PASS -> FAIL
> for the warning check) when that warning disappears (say, because the
> compiler can now offload the respective construct, yay).

That is my opinion as well, except that given the number of warnings
now (with dynamic parallelism disabled), I prefer to work on the file
granularity.  Also, often testcases use macros heavily and putting
dg-warning into them is somewhere between weird and outright
impossible.

On the other hand, as you have probably noticed, Jakub asked me to
pass -Wno-hsa to all tests instead so he seems to have the opposing
point of view.  I must say that I am not really ready to argue about
this too much, especially if we have our own HSA testsuite directory.

Martin

> 
> > A very similar problem also exists for nvptx offloading (Nathan CCed),
> > where we emit similar warnings (enabled by default).  As nvptx offloading
> > happens during link-time (not compile-time, as with hsa offloading),
> > these don't affect GCC's compile tests, but need to be worked around in
> > libgomp test cases.
> 
> 
> Grüße
>  Thomas

Reply via email to