diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-09-27 22:13:00 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-09-27 22:13:00 +0200 |
commit | 00798c58439037e3de959c3a003d6f4251eb93c6 (patch) | |
tree | d888baebfa3a8b271c3a35a2e2c92b325a40ab9a | |
parent | 576113abdb10ebdd141cdd3adb6884973c3d3c1d (diff) | |
download | gcc-00798c58439037e3de959c3a003d6f4251eb93c6.zip gcc-00798c58439037e3de959c3a003d6f4251eb93c6.tar.gz gcc-00798c58439037e3de959c3a003d6f4251eb93c6.tar.bz2 |
re PR middle-end/91920 (ggc 9.2.0 failing openmp compile on ppc64le)
PR middle-end/91920
* gimplify.c (omp_default_clause): Predetermine DECL_IN_CONSTANT_POOL
variables as shared.
* c-c++-common/gomp/pr91920.c: New test.
From-SVN: r276211
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimplify.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/pr91920.c | 19 |
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c935cf3..29f56d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-09-27 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/91920 + * gimplify.c (omp_default_clause): Predetermine DECL_IN_CONSTANT_POOL + variables as shared. + 2019-09-27 Iain Sandoe <iain@sandoe.co.uk> * config/rs6000/darwin.md (@macho_correct_pic_<mode>): New, diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 623cdbf..88d6571 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7132,6 +7132,8 @@ omp_default_clause (struct gimplify_omp_ctx *ctx, tree decl, kind = lang_hooks.decls.omp_predetermined_sharing (decl); if (kind != OMP_CLAUSE_DEFAULT_UNSPECIFIED) default_kind = kind; + else if (VAR_P (decl) && TREE_STATIC (decl) && DECL_IN_CONSTANT_POOL (decl)) + default_kind = OMP_CLAUSE_DEFAULT_SHARED; switch (default_kind) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8386c33..9aee20c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,10 @@ 2019-09-27 Jakub Jelinek <jakub@redhat.com> + PR middle-end/91920 + * c-c++-common/gomp/pr91920.c: New test. + PR target/91919 - * gcc.c-torture/compile/pr91919.c: New.test + * gcc.c-torture/compile/pr91919.c: New test. 2019-09-27 Manfred Schwarb <manfred99@gmx.ch> diff --git a/gcc/testsuite/c-c++-common/gomp/pr91920.c b/gcc/testsuite/c-c++-common/gomp/pr91920.c new file mode 100644 index 0000000..604fd59 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr91920.c @@ -0,0 +1,19 @@ +/* PR middle-end/91920 */ + +void bar (float *); + +void +foo (void) +{ + int i; + float f[3] = { 0.0f, 0.0f, 0.0f }; +#pragma omp parallel for default(none) reduction(+:f[:3]) + for (i = 0; i < 1000; i++) + { + int j; + float k[3] = { 0.25f, 0.5f, 0.75f }; + for (j = 0; j < 3; j++) + f[j] += k[j]; + } + bar (f); +} |