Hi!

On 2021-04-26T14:32:10+0200, Tobias Burnus <tob...@codesourcery.com> wrote:
> first, can you add an entry regarding this flag
> to https://gcc.gnu.org/gcc-12/changes.html ?

Is that a standard thing that all new command-line flags do get
highlighted there?  (I wouldn't have considered that one important
enough?)


> Secondly, I now see FAILs like:
>
> FAIL: gfortran.dg/goacc/classify-serial.f95   -O  (test for excess errors)
> Excess errors:
> gfortran.dg/goacc/classify-serial.f95:20:132: Warning: region contains gang 
> partitioned code but is not gang partitioned [-Wopenacc-parallelism]
> gfortran.dg/goacc/classify-serial.f95:20:132: Warning: region contains vector 
> partitioned code but is not vector partitioned [-Wopenacc-parallelism]

Eek!  I do reproduce that -- but only in a GCC build configuration
without offloading enabled!  For example, for
'gfortran.dg/goacc/classify-serial.f95', we've got the following diff in
diagnostics in a GCC build configuration without vs. with offloading
enabled:

    {+[...]/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95: In function 
'MAIN__._omp_fn.0':+}
    [...]/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95:20:132: 
[-Warning:-]{+warning:+} region contains gang partitioned code but is not gang 
partitioned [-Wopenacc-parallelism]
    [...]/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95:20:132: 
[-Warning:-]{+warning:+} region contains vector partitioned code but is not 
vector partitioned [-Wopenacc-parallelism]
    [...]/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95:20:132: 
optimized: assigned OpenACC gang vector loop parallelism
    PASS: gfortran.dg/goacc/classify-serial.f95   -O   (test for warnings, line 
20)
    [-XPASS:-]{+XFAIL:+} gfortran.dg/goacc/classify-serial.f95   -O  TODO 
'serial' (test for bogus messages, line 20)
    PASS: gfortran.dg/goacc/classify-serial.f95   -O   (test for bogus 
messages, line 20)
    [-XPASS:-]{+XFAIL:+} gfortran.dg/goacc/classify-serial.f95   -O  TODO 
'serial' (test for bogus messages, line 20)
    [-FAIL:-]{+PASS:+} gfortran.dg/goacc/classify-serial.f95   -O  (test for 
excess errors)[-Excess errors:-]
    [-[...]/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95:20:132: 
Warning: region contains gang partitioned code but is not gang partitioned 
[-Wopenacc-parallelism]-]
    [-[...]/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95:20:132: 
Warning: region contains vector partitioned code but is not vector partitioned 
[-Wopenacc-parallelism]-]
    PASS: gfortran.dg/goacc/classify-serial.f95   -O   scan-tree-dump-times 
ompexp "(?n)__attribute__\\(\\(oacc serial, omp target entrypoint\\)\\)" 1
    PASS: gfortran.dg/goacc/classify-serial.f95   -O   scan-tree-dump-times 
oaccdevlow "(?n)Function is OpenACC serial offload" 1
    PASS: gfortran.dg/goacc/classify-serial.f95   -O   scan-tree-dump-times 
oaccdevlow "(?n)Compute dimensions \\[1, 1, 1\\]" 1

Notice upper-case "Warning" vs. lower-case "warning".  That's for Fortran
only; for C, C++, it's lower-case "warning" for both build variants.

It's of course easy to fix up the regexp, but should we maybe rather
figure out how to unify the reporting?

I do understand that Fortran has some upper-case diagnostics, but I don't
understand the difference/relevance of GCC build configuration without
vs. with offloading enabled, how is that coming becoming relevant?

Also notice that the preamble "In function 'MAIN__._omp_fn.0':" only
appears in the GCC build configuration with offloading.  Looking at
'c-c++-common/goacc/classify-serial.c', for C, we've got "In function
'SERIAL._omp_fn.0':" for both GCC build configurations, and for C++,
we've got "In function '_Z6SERIALv._omp_fn.0':" without offloading
enabled vs. "In function 'SERIAL() [clone ._omp_fn.0]':" with offloading
enabled.

So there generally seems to be some difference in function outlining
setup without vs. with offloading enabled?  ..., and for Fortran, with
offloading enabled, that causes the outlined function to be
"de-Fortranified", thus the lower-case "warning" diagnostic?

> FAIL: gfortran.dg/goacc/kernels-decompose-2.f95   -O  (test for excess errors)
> Excess errors:
> gfortran.dg/goacc/kernels-decompose-2.f95:124:15: Warning: region contains 
> gang partitioned code but is not gang partitioned [-Wopenacc-parallelism]
>
> FAIL: gfortran.dg/goacc/routine-module-mod-1.f90 (test for excess errors)
> Excess errors:
> gfortran.dg/goacc/routine-module-mod-1.f90:56:16: Warning: region is worker 
> partitioned but does not contain worker partitioned code 
> [-Wopenacc-parallelism]

..., and similarly, several more in 'libgomp.oacc-fortran'.


Grüße
 Thomas


> On 26.04.21 12:39, Thomas Schwinge wrote:
>
>> Hi!
>>
>> On 2021-02-26T04:21:54-0800, Julian Brown <jul...@codesourcery.com> wrote:
>>> This patch adds warnings for strange partitioning choices -- specifying
>>> either more or fewer partitioning levels on a parallel directive than the
>>> enclosed offload region actually uses.
>> Thanks!
>>
>>> We've used a version of this patch on the og8/og9/og10 branches for
>>> quite a while.  Versions have been posted for mainline submission as
>>> part of a larger patch several times, e.g. here:
>>>
>>>    https://gcc.gnu.org/pipermail/gcc-patches/2018-October/507938.html
>>>
>>> One motivation for committing this patch is it removes an ongoing
>>> divergence in a large number of test cases between the og* branches and
>>> mainline, namely whether the added warnings are expected as a result of
>>> compiling those test cases, or not.
>>>
>>> The warnings themselves are perhaps slightly aggressive, but are intended
>>> to help the user write more efficient code.
>> As I'd said in
>> <http://mid.mail-archive.com/87zhoefcpf.fsf@euler.schwinge.homeip.net>:
>>
>> | The general intention is good, but I've seen cases where I considered
>> | these diagnostics to be too noisy.  See also the several 'dg-bogus'
>> | with XFAIL
>>
>> ... as well as 'dg-additional-options "-w"' being added.
>>
>> I've spent some more time on this; in particular, 'dg-bogus' with XFAIL
>> setup, to indicate individual items that I think need to be addressed.
>> (Please let me know if anybody makes a different categorization regarding
>> these.)  Of course, not all of our testcases are representative of
>> real-world code (but I've anyway removed '-w' in favor of 'dg-warning' or
>> 'dg-bogus' with XFAIL, for coverage), but I still came to the conclusion
>> that this is too noisy to enable by default (as had been proposed), and
>> thus for the time being have hidden it behind '-Wopenacc-parallelism'.
>> (Adding an option is good anyway, so that users are able to disable
>> unwanted diagnostics; we need to do that for other OpenACC diagnostics,
>> too.)  The goal is to eventually enable '-Wopenacc-parallelism', with
>> '-Wall' and some "special cases" with '-Wextra', I suppose.
>>
>> I've pushed "Add '-Wopenacc-parallelism'" to master branch in commit
>> 22cff118f7526bec195ed6e41452980820fdf3a8, see attached.
>>
>>
>> Grüße
>>   Thomas
>>
>>
> -----------------
> Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München 
> Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank 
> Thürauf
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München 
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank 
Thürauf

Reply via email to