diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-07-10 17:22:50 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-07-10 17:22:50 +0200 |
commit | b826efd98620ba65956843f515fb1698ea6feecf (patch) | |
tree | f4a082ece9e1b03e1028c0b236c631ddb2287f34 /gcc/omp-low.c | |
parent | 38a28aabc1c885725b749248165889e8f1e5180d (diff) | |
download | gcc-b826efd98620ba65956843f515fb1698ea6feecf.zip gcc-b826efd98620ba65956843f515fb1698ea6feecf.tar.gz gcc-b826efd98620ba65956843f515fb1698ea6feecf.tar.bz2 |
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
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 |