aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-imgcha.adb
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2025-02-25 09:29:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2025-02-25 09:29:39 +0100
commit86a4af2793393e47af6b78cb7094c97914890091 (patch)
tree32f3e251227ac72efb8a2df4d33bdbc807719617 /gcc/ada/s-imgcha.adb
parenta41b3f54c13890b1327bb3d4fbae8f7feb37d00b (diff)
downloadgcc-86a4af2793393e47af6b78cb7094c97914890091.zip
gcc-86a4af2793393e47af6b78cb7094c97914890091.tar.gz
gcc-86a4af2793393e47af6b78cb7094c97914890091.tar.bz2
openmp: Fix handling of declare target statics with array type which need destruction [PR118876]
The following testcase ICEs because it attempts to emit the __tcfa function twice, once when handling the host destruction and once when handling nohost destruction. This patch fixes it by using __omp_tcfa function for the nohost case and marks it with the needed "omp declare target" and "omp declare target nohost" attributes. 2025-02-25 Jakub Jelinek <jakub@redhat.com> PR c++/118876 * cp-tree.h (register_dtor_fn): Add a bool argument defaulted to false. * decl.cc (start_cleanup_fn): Add OMP_TARGET argument, use "__omp_tcf" prefix rather than "__tcf" in that case. Add "omp declare target" and "omp declare target nohost" attributes to the fndecl. (register_dtor_fn): Add OMP_TARGET argument, pass it down to start_cleanup_fn. * decl2.cc (one_static_initialization_or_destruction): Add OMP_TARGET argument, pass it down to register_dtor_fn. (emit_partial_init_fini_fn): Pass omp_target to one_static_initialization_or_destruction. (handle_tls_init): Pass false to one_static_initialization_or_destruction. * g++.dg/gomp/pr118876.C: New test.
Diffstat (limited to 'gcc/ada/s-imgcha.adb')
0 files changed, 0 insertions, 0 deletions