Hi! I'd like to merge (most of) gomp-4_0-branch to trunk. Except for unknown bugs and known outstanding unclear spots in the standard, the branch right now implements OpenMP 4.0 standard with the following caveats that I hope can be dealt with incrementally later on: 1) Fortran front-end support of OpenMP 4.0 isn't written, so Fortran will for now only support OpenMP 3.1 and earlier, except for library only features. 2) offloading isn't implemented, for the merge I've actually took out the splay tree and plugin support from target.c, because it was so far only useful for hack testing, there aren't any plugins yet and when there will be, target.c will need to be modified. #pragma omp target{, data, update} is supported, but will always for now fall back to host execution. 3) #pragma omp declare simd is right now parsed and diagnosed, but we don't actually generate the elemental function entry points (ABI issue for public function, but we have yet to decide on the ABI) and vectorizer doesn't use them (only optimization issue). 4) C++ tasks with firstprivate variables that need copy constructors can't be discarded right now during cancellation, because there is no way yet to call corresponding destructors. They will be therefore started and if they hit some early cancellation point, they will be cancelled there, otherwise they will simply run all the way through. Shouldn't be that hard to handle this, but IMHO can be done incrementally.
I've bootstrapped/regtested the merge on x86_64-linux and i686-linux. I think most of the patch if not all of it falls under my OpenMP maintainership and the vectorization part of the OpenMP 4.0 support has been merged earlier, still I'd appreciate acks from the front-end maintainers because the patch is very large and affects the frontends quite a lot. And of course, if anybody has further comments, they'll be appreciated. Because the patch is too large for gcc-patches limits (1.15MB), I've split it into 6 parts: [1/6] gcc/ support other than gcc/{c/,cp/,testsuite/} [2/6] C FE changes [3/6] C++ FE changes [4/6] gcc/testsuite [5/6] libgomp/ (other than libgomp/testsuite/) [6/6] libgomp/testsuite/ gcc/ada/gcc-interface/utils.c | 6 gcc/builtin-types.def | 35 gcc/c-family/c-common.c | 32 gcc/c-family/c-common.h | 148 gcc/c-family/c-cppbuiltin.c | 2 gcc/c-family/c-omp.c | 408 + gcc/c-family/c-pragma.c | 9 gcc/c-family/c-pragma.h | 39 gcc/c/c-decl.c | 176 gcc/c/c-lang.h | 3 gcc/c/c-parser.c | 4017 ++++++++++++---- gcc/c/c-tree.h | 9 gcc/c/c-typeck.c | 1015 ++++ gcc/cp/cp-array-notation.c | 1 gcc/cp/cp-gimplify.c | 22 gcc/cp/cp-objcp-common.h | 2 gcc/cp/cp-tree.h | 35 gcc/cp/decl.c | 52 gcc/cp/decl2.c | 63 gcc/cp/parser.c | 4552 +++++++++++++------ gcc/cp/parser.h | 18 gcc/cp/pt.c | 289 + gcc/cp/semantics.c | 1523 ++++++ gcc/fortran/f95-lang.c | 18 gcc/fortran/trans-openmp.c | 6 gcc/fortran/types.def | 36 gcc/gimple-low.c | 3 gcc/gimple-pretty-print.c | 119 gcc/gimple.c | 79 gcc/gimple.def | 24 gcc/gimple.h | 266 + gcc/gimplify.c | 603 ++ gcc/langhooks-def.h | 3 gcc/langhooks.c | 9 gcc/langhooks.h | 3 gcc/lto/lto-lang.c | 6 gcc/omp-builtins.def | 76 gcc/omp-low.c | 2646 +++++++++-- gcc/testsuite/c-c++-common/gomp/atomic-15.c | 34 gcc/testsuite/c-c++-common/gomp/atomic-16.c | 34 gcc/testsuite/c-c++-common/gomp/cancel-1.c | 396 + gcc/testsuite/c-c++-common/gomp/depend-1.c | 79 gcc/testsuite/c-c++-common/gomp/depend-2.c | 19 gcc/testsuite/c-c++-common/gomp/map-1.c | 103 gcc/testsuite/c-c++-common/gomp/pr58472.c | 16 gcc/testsuite/c-c++-common/gomp/sections1.c | 73 gcc/testsuite/c-c++-common/gomp/simd1.c | 31 gcc/testsuite/c-c++-common/gomp/simd2.c | 29 gcc/testsuite/c-c++-common/gomp/simd3.c | 26 gcc/testsuite/c-c++-common/gomp/simd4.c | 21 gcc/testsuite/c-c++-common/gomp/simd5.c | 19 gcc/testsuite/c-c++-common/gomp/single1.c | 15 gcc/testsuite/g++.dg/gomp/block-0.C | 6 gcc/testsuite/g++.dg/gomp/block-3.C | 6 gcc/testsuite/g++.dg/gomp/clause-3.C | 10 gcc/testsuite/g++.dg/gomp/declare-simd-1.C | 243 + gcc/testsuite/g++.dg/gomp/declare-simd-2.C | 67 gcc/testsuite/g++.dg/gomp/depend-1.C | 70 gcc/testsuite/g++.dg/gomp/depend-2.C | 87 gcc/testsuite/g++.dg/gomp/target-1.C | 32 gcc/testsuite/g++.dg/gomp/target-2.C | 32 gcc/testsuite/g++.dg/gomp/taskgroup-1.C | 32 gcc/testsuite/g++.dg/gomp/teams-1.C | 66 gcc/testsuite/g++.dg/gomp/udr-1.C | 119 gcc/testsuite/g++.dg/gomp/udr-2.C | 119 gcc/testsuite/g++.dg/gomp/udr-3.C | 191 gcc/testsuite/g++.dg/gomp/udr-4.C | 14 gcc/testsuite/g++.dg/gomp/udr-5.C | 41 gcc/testsuite/gcc.dg/autopar/outer-1.c | 2 gcc/testsuite/gcc.dg/autopar/outer-2.c | 2 gcc/testsuite/gcc.dg/autopar/outer-3.c | 2 gcc/testsuite/gcc.dg/autopar/outer-4.c | 2 gcc/testsuite/gcc.dg/autopar/outer-5.c | 2 gcc/testsuite/gcc.dg/autopar/outer-6.c | 2 gcc/testsuite/gcc.dg/autopar/parallelization-1.c | 2 gcc/testsuite/gcc.dg/gomp/block-3.c | 7 gcc/testsuite/gcc.dg/gomp/clause-1.c | 8 gcc/testsuite/gcc.dg/gomp/combined-1.c | 2 gcc/testsuite/gcc.dg/gomp/declare-simd-1.c | 100 gcc/testsuite/gcc.dg/gomp/declare-simd-2.c | 24 gcc/testsuite/gcc.dg/gomp/nesting-1.c | 41 gcc/testsuite/gcc.dg/gomp/target-1.c | 29 gcc/testsuite/gcc.dg/gomp/target-2.c | 29 gcc/testsuite/gcc.dg/gomp/taskgroup-1.c | 29 gcc/testsuite/gcc.dg/gomp/teams-1.c | 61 gcc/testsuite/gcc.dg/gomp/udr-1.c | 46 gcc/testsuite/gcc.dg/gomp/udr-2.c | 42 gcc/testsuite/gcc.dg/gomp/udr-3.c | 77 gcc/testsuite/gcc.dg/gomp/udr-4.c | 6 gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.5.f90 | 2 gcc/tree-cfg.c | 9 gcc/tree-core.h | 101 gcc/tree-inline.c | 21 gcc/tree-nested.c | 37 gcc/tree-pretty-print.c | 304 + gcc/tree-ssa-alias.c | 10 gcc/tree-vectorizer.c | 3 gcc/tree.c | 132 gcc/tree.def | 30 gcc/tree.h | 85 libgomp/Makefile.am | 2 libgomp/Makefile.in | 5 libgomp/barrier.c | 12 libgomp/config/linux/affinity.c | 361 + libgomp/config/linux/bar.c | 106 libgomp/config/linux/bar.h | 62 libgomp/config/linux/proc.c | 96 libgomp/config/linux/proc.h | 5 libgomp/config/posix/affinity.c | 79 libgomp/config/posix/bar.c | 132 libgomp/config/posix/bar.h | 58 libgomp/env.c | 797 +++ libgomp/fortran.c | 67 libgomp/hashtab.h | 443 + libgomp/libgomp.h | 140 libgomp/libgomp.map | 43 libgomp/libgomp.texi | 86 libgomp/libgomp_g.h | 35 libgomp/loop.c | 68 libgomp/omp.h.in | 40 libgomp/omp_lib.f90.in | 84 libgomp/omp_lib.h.in | 27 libgomp/parallel.c | 153 libgomp/sections.c | 26 libgomp/target.c | 96 libgomp/task.c | 717 ++ libgomp/team.c | 476 + libgomp/testsuite/libgomp.c++/affinity-1.C | 4 libgomp/testsuite/libgomp.c++/atomic-10.C | 99 libgomp/testsuite/libgomp.c++/atomic-11.C | 108 libgomp/testsuite/libgomp.c++/atomic-12.C | 58 libgomp/testsuite/libgomp.c++/atomic-13.C | 68 libgomp/testsuite/libgomp.c++/atomic-14.C | 99 libgomp/testsuite/libgomp.c++/atomic-15.C | 108 libgomp/testsuite/libgomp.c++/cancel-for-1.C | 29 libgomp/testsuite/libgomp.c++/cancel-for-2.C | 126 libgomp/testsuite/libgomp.c++/cancel-parallel-1.C | 18 libgomp/testsuite/libgomp.c++/cancel-parallel-2.C | 57 libgomp/testsuite/libgomp.c++/cancel-parallel-3.C | 50 libgomp/testsuite/libgomp.c++/cancel-sections-1.C | 43 libgomp/testsuite/libgomp.c++/cancel-taskgroup-1.C | 4 libgomp/testsuite/libgomp.c++/cancel-taskgroup-2.C | 4 libgomp/testsuite/libgomp.c++/cancel-taskgroup-3.C | 58 libgomp/testsuite/libgomp.c++/cancel-test.h | 47 libgomp/testsuite/libgomp.c++/for-10.C | 44 libgomp/testsuite/libgomp.c++/for-11.C | 108 libgomp/testsuite/libgomp.c++/for-9.C | 33 libgomp/testsuite/libgomp.c++/simd-1.C | 79 libgomp/testsuite/libgomp.c++/simd-2.C | 36 libgomp/testsuite/libgomp.c++/simd-3.C | 131 libgomp/testsuite/libgomp.c++/simd-4.C | 45 libgomp/testsuite/libgomp.c++/simd-5.C | 47 libgomp/testsuite/libgomp.c++/simd-6.C | 70 libgomp/testsuite/libgomp.c++/simd-7.C | 72 libgomp/testsuite/libgomp.c++/simd-8.C | 47 libgomp/testsuite/libgomp.c++/target-1.C | 1 libgomp/testsuite/libgomp.c++/target-2-aux.cc | 5 libgomp/testsuite/libgomp.c++/target-2.C | 58 libgomp/testsuite/libgomp.c++/target-3.C | 1 libgomp/testsuite/libgomp.c++/taskgroup-1.C | 1 libgomp/testsuite/libgomp.c++/udr-1.C | 82 libgomp/testsuite/libgomp.c++/udr-2.C | 88 libgomp/testsuite/libgomp.c++/udr-3.C | 149 libgomp/testsuite/libgomp.c++/udr-4.C | 32 libgomp/testsuite/libgomp.c++/udr-5.C | 49 libgomp/testsuite/libgomp.c++/udr-6.C | 70 libgomp/testsuite/libgomp.c++/udr-7.C | 72 libgomp/testsuite/libgomp.c++/udr-8.C | 39 libgomp/testsuite/libgomp.c++/udr-9.C | 3 libgomp/testsuite/libgomp.c/affinity-1.c | 1146 ++++ libgomp/testsuite/libgomp.c/atomic-14.c | 4 libgomp/testsuite/libgomp.c/atomic-15.c | 99 libgomp/testsuite/libgomp.c/atomic-16.c | 58 libgomp/testsuite/libgomp.c/atomic-17.c | 99 libgomp/testsuite/libgomp.c/cancel-for-1.c | 22 libgomp/testsuite/libgomp.c/cancel-for-2.c | 95 libgomp/testsuite/libgomp.c/cancel-parallel-1.c | 17 libgomp/testsuite/libgomp.c/cancel-parallel-2.c | 53 libgomp/testsuite/libgomp.c/cancel-parallel-3.c | 39 libgomp/testsuite/libgomp.c/cancel-sections-1.c | 38 libgomp/testsuite/libgomp.c/cancel-taskgroup-1.c | 70 libgomp/testsuite/libgomp.c/cancel-taskgroup-2.c | 37 libgomp/testsuite/libgomp.c/depend-1.c | 215 libgomp/testsuite/libgomp.c/depend-2.c | 71 libgomp/testsuite/libgomp.c/depend-3.c | 51 libgomp/testsuite/libgomp.c/depend-4.c | 56 libgomp/testsuite/libgomp.c/for-1.c | 35 libgomp/testsuite/libgomp.c/for-1.h | 25 libgomp/testsuite/libgomp.c/for-2.c | 46 libgomp/testsuite/libgomp.c/for-2.h | 269 + libgomp/testsuite/libgomp.c/for-3.c | 110 libgomp/testsuite/libgomp.c/pr58392.c | 58 libgomp/testsuite/libgomp.c/simd-1.c | 57 libgomp/testsuite/libgomp.c/simd-2.c | 36 libgomp/testsuite/libgomp.c/simd-3.c | 131 libgomp/testsuite/libgomp.c/simd-4.c | 42 libgomp/testsuite/libgomp.c/simd-5.c | 44 libgomp/testsuite/libgomp.c/simd-6.c | 44 libgomp/testsuite/libgomp.c/target-1.c | 90 libgomp/testsuite/libgomp.c/target-2.c | 88 libgomp/testsuite/libgomp.c/target-3.c | 17 libgomp/testsuite/libgomp.c/target-4.c | 14 libgomp/testsuite/libgomp.c/target-5.c | 83 libgomp/testsuite/libgomp.c/target-6.c | 68 libgomp/testsuite/libgomp.c/target-7.c | 111 libgomp/testsuite/libgomp.c/taskgroup-1.c | 83 libgomp/testsuite/libgomp.c/thread-limit-1.c | 41 libgomp/testsuite/libgomp.c/thread-limit-2.c | 57 libgomp/testsuite/libgomp.c/thread-limit-3.c | 12 libgomp/testsuite/libgomp.c/udr-1.c | 81 libgomp/testsuite/libgomp.c/udr-2.c | 27 libgomp/testsuite/libgomp.c/udr-3.c | 32 libgomp/work.c | 36 213 files changed, 26716 insertions(+), 3381 deletions(-) Jakub