Backported from mainline
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.
* c-c++-common/gomp/pr91920.c: New test.
From-SVN: r277252
2019-10-21 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 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-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/91723
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)
{
2019-10-21 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91920
+ * c-c++-common/gomp/pr91920.c: New test.
+
2019-09-11 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/89435
--- /dev/null
+/* 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);
+}