]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Fix up declare target handling for vars with DECL_LOCAL_DECL_ALIAS [PR102640]
authorJakub Jelinek <jakub@redhat.com>
Fri, 8 Oct 2021 08:58:56 +0000 (10:58 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 8 Oct 2021 08:58:56 +0000 (10:58 +0200)
commitdb3d7270b42fe27fb05664c4fdf524ab7ad13a75
tree67c3a282e927e6b783050f4fc0525954be83edde
parent90285ce98f3c69f275c05397f7c74d22462edc05
openmp: Fix up declare target handling for vars with DECL_LOCAL_DECL_ALIAS [PR102640]

The introduction of DECL_LOCAL_DECL_ALIAS and push_local_extern_decl_alias
in r11-3699-g4e62aca0e0520e4ed2532f2d8153581190621c1a broke the following
testcase.  The following patch fixes it by treating similarly not just
the variable to or link clause is put on, but also its DECL_LOCAL_DECL_ALIAS
if any.  If it hasn't been created yet, when it is created it will copy
attributes and therefore should get it for free, and as it is an extern,
nothing more than attributes is needed for it.

2021-10-08  Jakub Jelinek  <jakub@redhat.com>

PR c++/102640
gcc/cp/
* parser.c (handle_omp_declare_target_clause): New function.
(cp_parser_omp_declare_target): Use it.
gcc/testsuite/
* c-c++-common/gomp/pr102640.c: New test.
gcc/cp/parser.c
gcc/testsuite/c-c++-common/gomp/pr102640.c [new file with mode: 0644]