OpenACC: Fix pattern in dg-bogus in Fortran testcases again
authorTobias Burnus <tobias@codesourcery.com>
Mon, 26 Apr 2021 20:59:21 +0000 (22:59 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 26 Apr 2021 21:13:22 +0000 (23:13 +0200)
commitbd7ebe9da745a62184052dd1b15f4dd10fbdc9f4
treebc4786996642467c9a4455070d804d6e1926be8d
parente6455a099ec74071ba9c011cc314a48cadbe2bfe
OpenACC: Fix pattern in dg-bogus in Fortran testcases again

It turned out that a compiler built without offloading support
and one with can produce slightly different diagnostic.

Offloading support implies ENABLE_OFFLOAD which implies that
g->have_offload is set when offloading is actually needed.
In cgraphunit.c, the latter causes flag_generate_offload = 1,
which in turn affects tree.c's free_lang_data.

The result is that the front-end specific diagnostic gets reset
('tree_diagnostics_defaults (global_dc)'), which affects in this
case 'Warning' vs. 'warning' via the Fortran frontend.

Result: 'Warning:' vs. 'warning:'.
Side note: Other FE also override the diagnostic, leading to
similar differences, e.g. the C++ FE outputs mangled function
names differently, cf. patch thread.

libgomp/ChangeLog:

* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f:
Use [Ww]arning in dg-bogus as FE diagnostic and default
diagnostic differ and the result depends on ENABLE_OFFLOAD.
* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/goacc/classify-serial.f95:
Use [Ww]arning in dg-bogus as FE diagnostic and default
diagnostic differ and the result depends on ENABLE_OFFLOAD.
* gfortran.dg/goacc/kernels-decompose-2.f95: Likewise.
* gfortran.dg/goacc/routine-module-mod-1.f90: Likewise.
gcc/testsuite/gfortran.dg/goacc/classify-serial.f95
gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95
gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90
libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f
libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f
libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90
libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90