diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-02-09 15:01:44 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-02-09 15:01:44 +0100 |
commit | 56f71478487174d7bacbe51a9c35d23257db905e (patch) | |
tree | ba5ea5a312dcc3928e3e794b521fe4484cde12e0 /gcc/gimplify.c | |
parent | 1bbe0d8f47f2007fcb70d69a0952347ece474ac7 (diff) | |
download | gcc-56f71478487174d7bacbe51a9c35d23257db905e.zip gcc-56f71478487174d7bacbe51a9c35d23257db905e.tar.gz gcc-56f71478487174d7bacbe51a9c35d23257db905e.tar.bz2 |
re PR c/79431 (ICE in get, at cgraph.h:397)
PR c/79431
* gimplify.c (gimplify_adjust_omp_clauses): Ignore
"omp declare target link" attribute unless is_global_var.
* omp-offload.c (find_link_var_op): Likewise.
c/
* c-parser.c (c_parser_omp_declare_target): Don't invoke
symtab_node::get on automatic variables.
cp/
* parser.c (cp_parser_oacc_declare): Formatting fix.
(cp_parser_omp_declare_target): Don't invoke symtab_node::get on
automatic variables.
testsuite/
* c-c++-common/gomp/pr79431.c: New test.
From-SVN: r245302
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index dd73fc2..1b9c8d2 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -8938,8 +8938,9 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p, if ((ctx->region_type & ORT_TARGET) != 0 && !(n->value & GOVD_SEEN) && GOMP_MAP_ALWAYS_P (OMP_CLAUSE_MAP_KIND (c)) == 0 - && !lookup_attribute ("omp declare target link", - DECL_ATTRIBUTES (decl))) + && (!is_global_var (decl) + || !lookup_attribute ("omp declare target link", + DECL_ATTRIBUTES (decl)))) { remove = true; /* For struct element mapping, if struct is never referenced |