2008-07-10 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/36790
+ * omp-low.c (lower_omp_2): If task_shared_vars, test all DECL_P
+ uids in the bitmap, not just VAR_DECL uids.
+
PR rtl-optimization/36419
* combine-stack-adj.c (adjust_frame_related_expr): New function.
(combine_stack_adjustments_for_block): Call it if needed. Delete
omp_context *ctx = (omp_context *) data;
/* Any variable with DECL_VALUE_EXPR needs to be regimplified. */
- if (TREE_CODE (t) == VAR_DECL
- && ((ctx && DECL_HAS_VALUE_EXPR_P (t))
- || (task_shared_vars
- && bitmap_bit_p (task_shared_vars, DECL_UID (t)))))
+ if (TREE_CODE (t) == VAR_DECL && ctx && DECL_HAS_VALUE_EXPR_P (t))
+ return t;
+
+ if (task_shared_vars
+ && DECL_P (t)
+ && bitmap_bit_p (task_shared_vars, DECL_UID (t)))
return t;
/* If a global variable has been privatized, TREE_CONSTANT on
2008-07-10 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/36790
+ * gcc.dg/gomp/pr36790.c: New test.
+ * g++.dg/gomp/pr36790.C: New test.
+
PR rtl-optimization/36419
* g++.dg/eh/async-unwind1.C: New test.
--- /dev/null
+// PR middle-end/36790
+// { dg-do compile }
+// { dg-options "-fopenmp -O2" }
+
+void
+foo (bool b)
+{
+}
+
+void
+bar (bool b)
+{
+ foo (b);
+ #pragma omp task default (shared)
+ b = false;
+}
+
+int
+main ()
+{
+ bar (false);
+ return 0;
+}
--- /dev/null
+/* PR middle-end/36790 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (char b)
+{
+}
+
+void
+bar (char b)
+{
+ foo (b);
+ #pragma omp task default (shared)
+ b = 0;
+}
+
+int
+main ()
+{
+ bar (0);
+ return 0;
+}