diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-04-25 20:09:35 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-04-25 20:09:35 +0200 |
commit | 14d48516e588ad2b35e2007b3970bdcb1b3f145c (patch) | |
tree | 4088427bdae67fa07ef08fc8606a6d5b08a8bcf8 /libgcc | |
parent | 8d80e3c5a641556e32fdf3637f08a0648f5aaab3 (diff) | |
download | gcc-14d48516e588ad2b35e2007b3970bdcb1b3f145c.zip gcc-14d48516e588ad2b35e2007b3970bdcb1b3f145c.tar.gz gcc-14d48516e588ad2b35e2007b3970bdcb1b3f145c.tar.bz2 |
openmp: Copy DECL_LANG_SPECIFIC and DECL_LANG_FLAG_? to tree-nested decl copy [PR114825]
tree-nested.cc creates in 2 spots artificial VAR_DECLs, one of them is used
both for debug info and OpenMP/OpenACC lowering purposes, the other solely for
OpenMP/OpenACC lowering purposes.
When the decls are used in OpenMP/OpenACC lowering, the OMP langhooks (mostly
Fortran, C just a little and C++ doesn't have nested functions) then inspect
the flags on the vars and based on that decide how to lower the corresponding
clauses.
Unfortunately we weren't copying DECL_LANG_SPECIFIC and DECL_LANG_FLAG_?, so
the langhooks made decisions on the default flags on those instead.
As the original decl isn't necessarily a VAR_DECL, could be e.g. PARM_DECL,
using copy_node wouldn't work properly, so this patch just copies those
flags in addition to other flags it was copying already. And I've removed
code duplication by introducing a helper function which does copying common
to both uses.
2024-04-25 Jakub Jelinek <jakub@redhat.com>
PR fortran/114825
* tree-nested.cc (get_debug_decl): New function.
(get_nonlocal_debug_decl): Use it.
(get_local_debug_decl): Likewise.
* gfortran.dg/gomp/pr114825.f90: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions