From b826efd98620ba65956843f515fb1698ea6feecf Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 10 Jul 2008 17:22:50 +0200 Subject: re PR middle-end/36790 (ICE on valid code: OpenMP task construct with default(shared) clause) 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. * gcc.dg/gomp/pr36790.c: New test. * g++.dg/gomp/pr36790.C: New test. From-SVN: r137695 --- gcc/omp-low.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/omp-low.c') diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 4378c43..2f9aede 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -6246,10 +6246,12 @@ lower_omp_2 (tree *tp, int *walk_subtrees, void *data) 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 -- cgit v1.1