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/cp/parser.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/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 41b08e1..b46ee7c 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -36230,7 +36230,7 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok) id = get_identifier ("omp declare target"); DECL_ATTRIBUTES (decl) - = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (decl)); + = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (decl)); if (global_bindings_p ()) { symtab_node *node = symtab_node::get (decl); @@ -36770,8 +36770,11 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok) } if (!at1) { - symtab_node *node = symtab_node::get (t); DECL_ATTRIBUTES (t) = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (t)); + if (TREE_CODE (t) != FUNCTION_DECL && !is_global_var (t)) + continue; + + symtab_node *node = symtab_node::get (t); if (node != NULL) { node->offloadable = 1; |