[TCWG CI] Regression caused by gcc: GCC11 - Fortran: combined directives - 
order(concurrent) not on distribute:
commit b1dc26d3543d79805751c26ba5b142eeeb1f55b8
Author: Tobias Burnus <tob...@codesourcery.com>

    GCC11 - Fortran: combined directives - order(concurrent) not on distribute

Results regressed to
# reset_artifacts:
-10
# build_abe binutils:
-9
# build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer --set 
gcc_override_configure=--disable-multilib --set 
gcc_override_configure=--with-cpu=cortex-m4 --set 
gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--with-float=hard:
-8
# build_abe newlib:
-6
# build_abe stage2 -- --patch linaro-local/vect-metric-branch --set 
gcc_override_configure=--disable-libsanitizer --set 
gcc_override_configure=--disable-multilib --set 
gcc_override_configure=--with-cpu=cortex-m4 --set 
gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--with-float=hard:
-5
# true:
0
# benchmark -- -O3_LTO_VECT_mthumb 
artifacts/build-b1dc26d3543d79805751c26ba5b142eeeb1f55b8/results_id:
1

from
# reset_artifacts:
-10
# build_abe binutils:
-9
# build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer --set 
gcc_override_configure=--disable-multilib --set 
gcc_override_configure=--with-cpu=cortex-m4 --set 
gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--with-float=hard:
-8
# build_abe newlib:
-6
# build_abe stage2 -- --patch linaro-local/vect-metric-branch --set 
gcc_override_configure=--disable-libsanitizer --set 
gcc_override_configure=--disable-multilib --set 
gcc_override_configure=--with-cpu=cortex-m4 --set 
gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--with-float=hard:
-5
# true:
0
# benchmark -- -O3_LTO_VECT_mthumb artifacts/build-baseline/results_id:
1

THIS IS THE END OF INTERESTING STUFF.  BELOW ARE LINKS TO BUILDS, REPRODUCTION 
INSTRUCTIONS, AND THE RAW COMMIT.

This commit has regressed these CI configurations:
 - tcwg_bmk_gnu_eabi_stm32/gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT

First_bad build: 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/build-b1dc26d3543d79805751c26ba5b142eeeb1f55b8/
Last_good build: 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/build-79c523d40de1b7ce1dd0f4865c0855ab2bf6744b/
Baseline build: 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/build-baseline/
Even more details: 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/

Reproduce builds:
<cut>
mkdir investigate-gcc-b1dc26d3543d79805751c26ba5b142eeeb1f55b8
cd investigate-gcc-b1dc26d3543d79805751c26ba5b142eeeb1f55b8

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests and test.sh script
mkdir -p artifacts/manifests
curl -o artifacts/manifests/build-baseline.sh 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/manifests/build-baseline.sh
 --fail
curl -o artifacts/manifests/build-parameters.sh 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/manifests/build-parameters.sh
 --fail
curl -o artifacts/test.sh 
https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_eabi-release-arm_eabi-coremark-O3_LTO_VECT/1/artifact/artifacts/test.sh
 --fail
chmod +x artifacts/test.sh

# Reproduce the baseline build (build all pre-requisites)
./jenkins-scripts/tcwg_bmk-build.sh @@ artifacts/manifests/build-baseline.sh

# Save baseline build state (which is then restored in artifacts/test.sh)
mkdir -p ./bisect
rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ 
--exclude /gcc/ ./ ./bisect/baseline/

cd gcc

# Reproduce first_bad build
git checkout --detach b1dc26d3543d79805751c26ba5b142eeeb1f55b8
../artifacts/test.sh

# Reproduce last_good build
git checkout --detach 79c523d40de1b7ce1dd0f4865c0855ab2bf6744b
../artifacts/test.sh

cd ..
</cut>

Full commit (up to 1000 lines):
<cut>
commit b1dc26d3543d79805751c26ba5b142eeeb1f55b8
Author: Tobias Burnus <tob...@codesourcery.com>
Date:   Mon Sep 20 17:24:56 2021 +0200

    GCC11 - Fortran: combined directives - order(concurrent) not on distribute
    
    While OpenMP 5.1 and GCC 12 permits 'order(concurrent)' on distribute,
    OpenMP 5.0 and GCC 11 don't. This patch for GCC 11 ensures the clause also
    does not end up on 'distribute' when splitting combined directives.
    
    gcc/fortran/ChangeLog:
    
            * trans-openmp.c (gfc_split_omp_clauses): Don't put 
'order(concurrent)'
            on 'distribute' for combined directives, matching OpenMP 5.0
    
    gcc/testsuite/ChangeLog:
    
            * gfortran.dg/gomp/distribute-order-concurrent.f90: New test.
---
 gcc/fortran/trans-openmp.c                         |  2 --
 .../gomp/distribute-order-concurrent.f90           | 25 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 7e931bf4bc7..973d916b4a2 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -5176,8 +5176,6 @@ gfc_split_omp_clauses (gfc_code *code,
          /* Duplicate collapse.  */
          clausesa[GFC_OMP_SPLIT_DISTRIBUTE].collapse
            = code->ext.omp_clauses->collapse;
-         clausesa[GFC_OMP_SPLIT_DISTRIBUTE].order_concurrent
-           = code->ext.omp_clauses->order_concurrent;
        }
       if (mask & GFC_OMP_MASK_PARALLEL)
        {
diff --git a/gcc/testsuite/gfortran.dg/gomp/distribute-order-concurrent.f90 
b/gcc/testsuite/gfortran.dg/gomp/distribute-order-concurrent.f90
new file mode 100644
index 00000000000..9597d913684
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/distribute-order-concurrent.f90
@@ -0,0 +1,25 @@
+! { dg-additional-options "-fdump-tree-original" }
+!
+! In OpenMP 5.0, 'order(concurrent)' does not apply to distribute
+! Ensure that it is rejected in GCC 11.
+! 
+! Note: OpenMP 5.1 allows it; the GCC 12 testcase for it is 
gfortran.dg/gomp/order-5.f90
+
+subroutine f(a)
+implicit none
+integer :: i, thr
+!save :: thr
+integer :: a(:)
+
+!$omp distribute parallel do order(concurrent) private(thr)
+  do i = 1, 10
+    thr = 5
+    a(i) = thr
+  end do
+!$omp end distribute parallel do
+end
+
+! { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*order" "original" } }
+! { dg-final { scan-tree-dump "#pragma omp distribute\[\n\r\]" "original" } }
+! { dg-final { scan-tree-dump "#pragma omp parallel private\\(thr\\)" 
"original" } }
+! { dg-final { scan-tree-dump "#pragma omp for nowait order\\(concurrent\\)" 
"original" } }
</cut>
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to