From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id ABC753838028; Mon, 26 Apr 2021 21:23:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABC753838028 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: 0gMmLF3odFY6iWqnBxRkzrZVgXNsuJ5HWtBM3ch5pAJl9U85KosMa+sCHCgQ9wX+HezoWGYzzG s3zQMEnzUULj4dXzLC99UH46xxGOJygCDMcxglNBURv1acGASBVDz+yOGGVaiGu5XQRjuK5OvX BF563jz/Cq61HCuABVpPrl9PZ9AHkSLs3PGRhF8+6yaDAQTvT5LadBVoAWhYaCYsMS5S9+JPGG a6LmuuuQMHnX1YbaA0fIGl2C65e7WwIxdz9FNU+8OXogTlOpGlfmp/VHDA4b3Y7cv/m0T0njhH 6Qc= X-IronPort-AV: E=Sophos;i="5.82,252,1613462400"; d="diff'?scan'208";a="60522244" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 26 Apr 2021 13:23:56 -0800 IronPort-SDR: Jk3GAsygLZdnlTPMo4RP7hjy9buUPaKx2eQD2GsOlSHaoi6ZUyjKvFfAwO4IV+ZTcJWHk8Eafi ND8yt3xBzC+Fj8sWWRi9RyKb4qWB/RIv5dv6qe36v773ltZsYot0krwhka0bUAfS28JfYyL+3h DTAXp3C2GWlMyHBI6G27yPtsPoaqKVejM3zSIuFn38y6hKNVKNazrU4pkwnSfxFq3E3xEk8Fse kxs5BxDrsvtoYO6L2+WQr5+6k+9Pr3Lf1u1+rAvlAH2pIhoswLYG0AyQ5XGXGifrIUaP+EK8ys 9uE= Subject: [Patch, committed] OpenACC: Fix pattern in dg-bogus in Fortran testcases again (Re: [PATCH] openacc: Warnings for strange partitioning choices for parallel regions) From: Tobias Burnus To: Thomas Schwinge CC: Jakub Jelinek , Julian Brown , , References: <20210226122154.5209-1-julian@codesourcery.com> <871raxuy7g.fsf@euler.schwinge.homeip.net> <87pmyg4y9s.fsf@euler.schwinge.homeip.net> Message-ID: Date: Mon, 26 Apr 2021 23:23:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------B04FAD6F956142C49B303FE4" Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 21:23:59 -0000 --------------B04FAD6F956142C49B303FE4 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi all, as discussed below/in this thread, the reset of the diagnostic contest affects the output with ENABLE_OFFLOAD. The attached patch now uses [Ww]arning in dg-bogus. It might be possible to reduce the differences between ENABLE_OFFLOAD being true or false, but it does not seem to be simple and may not be worth the effort. In any case, this patch should permit to have no FAIL with ENABLE_OFFLOAD set and unset. =E2=80=93 And should make the testers happy. Committed as r12-135-gbd7ebe9da745a62184052dd1b15f4dd10fbdc9f4 Tobias PS: 'Warning:' with Fortran diagnostic and ENABLE_OFFSET unset, 'warning:' with default diagnostic and ENABLE_OFFSET set =E2=80=93 due to: On 26.04.21 22:51, Tobias Burnus wrote: > I believe this is done in tree.c's free_lang_data: > if (in_lto_p > || (!flag_generate_lto && !flag_generate_offload)) > ... > return 0; > } > > /* Reset diagnostic machinery. */ > tree_diagnostics_defaults (global_dc); > > And in cgraphunit.c's symbol_table::finalize_compilation_unit > if (!in_lto_p && g->have_offload) > flag_generate_offload =3D 1; > > And g->have_offload is guarded by ENABLE_OFFLOAD. ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf --------------B04FAD6F956142C49B303FE4 Content-Type: text/x-patch; charset="UTF-8"; name="committed.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="committed.diff" commit bd7ebe9da745a62184052dd1b15f4dd10fbdc9f4 Author: Tobias Burnus Date: Mon Apr 26 22:59:21 2021 +0200 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 | 6 +++--- gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95 | 2 +- gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90 | 2 +- libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f | 4 ++-- libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f | 4 ++-- libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 | 6 +++--- libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90 | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95 b/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95 index 386b95e78e4..6dcb1b170f8 100644 --- a/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95 +++ b/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95 @@ -18,9 +18,9 @@ program main call setup(a, b) !$acc serial loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } - ! { dg-bogus "Warning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 } - ! { dg-bogus "Warning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 } - ! { dg-bogus "Warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 } + ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 } + ! { dg-bogus "\[Ww\]arning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 } + ! { dg-bogus "\[Ww\]arning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 } do i = 0, n - 1 c(i) = a(i) + b(i) end do diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95 index 1277ad9ddda..238482b91a4 100644 --- a/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95 +++ b/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95 @@ -122,7 +122,7 @@ program main !$acc end kernels !$acc kernels - ! { dg-bogus "Warning: region contains gang partitioned code but is not gang partitioned" "TODO 'kernels'" { xfail *-*-* } .-1 } + ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'kernels'" { xfail *-*-* } .-1 } y = f_g (a(5)) ! { dg-line l_part[incr c_part] } !TODO If such a construct is placed in its own part (like it is, here), can't this actually use gang paralelism, instead of "gang-single"? ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" "" { target *-*-* } l_part$c_part } diff --git a/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90 b/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90 index 198ae01914b..835619c6509 100644 --- a/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90 @@ -56,7 +56,7 @@ contains subroutine g_1 implicit none !$acc routine gang - ! { dg-bogus "Warning: region is worker partitioned but does not contain worker partitioned code" "TODO default 'gang' 'vector'" { xfail *-*-* } .-3 } + ! { dg-bogus "\[Ww\]arning: region is worker partitioned but does not contain worker partitioned code" "TODO default 'gang' 'vector'" { xfail *-*-* } .-3 } integer :: i diff --git a/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f b/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f index baa472b3e87..1fe1b471107 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f +++ b/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f @@ -18,7 +18,7 @@ !$ACC PARALLEL NUM_GANGS(256) NUM_WORKERS(32) VECTOR_LENGTH(32) !$ACC& REDUCTION(+:RES1) COPY(RES1, RES2) ASYNC(1) -! { dg-bogus "Warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } +! { dg-bogus "\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-3 } res1 = res1 + 5 @@ -43,7 +43,7 @@ !$ACC PARALLEL NUM_GANGS(8) NUM_WORKERS(32) VECTOR_LENGTH(32) !$ACC& REDUCTION(*:RES1) COPY(RES1, RES2) ASYNC(1) -! { dg-bogus "Warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } +! { dg-bogus "\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-3 } res1 = res1 * 5 diff --git a/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f b/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f index 4ebab6c7b18..0221ab81281 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f +++ b/libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f @@ -18,7 +18,7 @@ !$ACC PARALLEL NUM_GANGS(256) NUM_WORKERS(32) VECTOR_LENGTH(32) !$ACC& REDUCTION(+:RES1) COPY(RES1, RES2) ASYNC(1) -! { dg-bogus "Warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } +! { dg-bogus "\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-3 } res1 = res1 + 5 @@ -43,7 +43,7 @@ !$ACC PARALLEL NUM_GANGS(8) NUM_WORKERS(32) VECTOR_LENGTH(32) !$ACC& REDUCTION(*:RES1) COPY(RES1, RES2) ASYNC(1) -! { dg-bogus "Warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } +! { dg-bogus "\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-1 } ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-3 } res1 = res1 * 5 diff --git a/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 b/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 index d9847969369..f69ab5a6642 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 @@ -87,9 +87,9 @@ program main vectors_max = -huge(gangs_max) - 1 ! INT_MIN !$acc serial copy (vectors_actual) & !$acc copy (gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max) ! { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } } - ! { dg-bogus "Warning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 } - ! { dg-bogus "Warning: region contains worker partitioned code but is not worker partitioned" "TODO 'serial'" { xfail *-*-* } .-2 } - ! { dg-bogus "Warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 } + ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 } + ! { dg-bogus "\[Ww\]arning: region contains worker partitioned code but is not worker partitioned" "TODO 'serial'" { xfail *-*-* } .-2 } + ! { dg-bogus "\[Ww\]arning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 } if (acc_on_device (acc_device_nvidia)) then ! The GCC nvptx back end enforces vector_length (32). ! It's unclear if that's actually permissible here; diff --git a/libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90 b/libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90 index af25f0dac9b..99b1441136d 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90 @@ -13,7 +13,7 @@ program reduction s2 = 0 !$acc parallel reduction(+:s1,s2) num_gangs (n) copy(s1) - ! { dg-bogus "Warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } + ! { dg-bogus "\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } s1 = s1 + 1 s2 = s2 + 1 !$acc end parallel @@ -44,7 +44,7 @@ subroutine redsub(s1, s2, n) integer :: s1, s2, n !$acc parallel reduction(+:s1,s2) num_gangs (10) copy(s1) - ! { dg-bogus "Warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } + ! { dg-bogus "\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } s1 = s1 + 1 s2 = s2 + 1 !$acc end parallel --------------B04FAD6F956142C49B303FE4--