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/c/c-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/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 6e83728..8f4f569b 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -16849,8 +16849,11 @@ c_parser_omp_declare_target (c_parser *parser) } 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; |