aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-09-10 09:32:54 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-09-10 09:32:54 +0200
commitcbdfbde871992d05f9fbd6118196f5eeadfc91e6 (patch)
tree73b8b7ec10420ebc8087e34c4750882b8b166950 /gcc/gimplify.c
parent2ee10f818d0ae2d421ff6df19923acf509d71721 (diff)
downloadgcc-cbdfbde871992d05f9fbd6118196f5eeadfc91e6.zip
gcc-cbdfbde871992d05f9fbd6118196f5eeadfc91e6.tar.gz
gcc-cbdfbde871992d05f9fbd6118196f5eeadfc91e6.tar.bz2
re PR middle-end/67521 (ICE when OpenMP loop expressions mention the IV)
PR middle-end/67521 * gimplify.c (gimplify_omp_for): Don't call omp_add_variable if decl is already in outer->variables. * c-c++-common/gomp/pr67521.c: New test. From-SVN: r227609
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 2a7da25..5030318 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -7163,10 +7163,16 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
outer = NULL;
if (outer)
{
- omp_add_variable (outer, decl,
- GOVD_LASTPRIVATE | GOVD_SEEN);
- if (outer->outer_context)
- omp_notice_variable (outer->outer_context, decl, true);
+ n = splay_tree_lookup (outer->variables,
+ (splay_tree_key)decl);
+ if (n == NULL || (n->value & GOVD_DATA_SHARE_CLASS) == 0)
+ {
+ omp_add_variable (outer, decl,
+ GOVD_LASTPRIVATE | GOVD_SEEN);
+ if (outer->outer_context)
+ omp_notice_variable (outer->outer_context, decl,
+ true);
+ }
}
}
}
@@ -7201,10 +7207,16 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
outer = NULL;
if (outer)
{
- omp_add_variable (outer, decl,
- GOVD_LASTPRIVATE | GOVD_SEEN);
- if (outer->outer_context)
- omp_notice_variable (outer->outer_context, decl, true);
+ n = splay_tree_lookup (outer->variables,
+ (splay_tree_key)decl);
+ if (n == NULL || (n->value & GOVD_DATA_SHARE_CLASS) == 0)
+ {
+ omp_add_variable (outer, decl,
+ GOVD_LASTPRIVATE | GOVD_SEEN);
+ if (outer->outer_context)
+ omp_notice_variable (outer->outer_context, decl,
+ true);
+ }
}
}