aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2025-04-16 14:00:31 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2025-04-16 16:03:04 +0200
commitca9cffe737d20953082333dacebb65d4261e0d0c (patch)
treed1b6b788b813ca226d8352140d61ac93e37b9e4a /gcc
parenteabba7be040e81690332070873d59d23e8c93e11 (diff)
downloadgcc-ca9cffe737d20953082333dacebb65d4261e0d0c.zip
gcc-ca9cffe737d20953082333dacebb65d4261e0d0c.tar.gz
gcc-ca9cffe737d20953082333dacebb65d4261e0d0c.tar.bz2
For nvptx offloading, make sure to emit C++ constructor, destructor aliases [PR97106]
PR target/97106 gcc/ * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls) [ACCEL_COMPILER]: Make sure to emit C++ constructor, destructor aliases. libgomp/ * testsuite/libgomp.c++/pr96390.C: Un-XFAIL nvptx offloading. * testsuite/libgomp.c-c++-common/pr96390.c: Adjust.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/nvptx/nvptx.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 28da43c..d1e25b9 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -7789,6 +7789,18 @@ nvptx_asm_output_def_from_decls (FILE *stream, tree name,
#endif
cgraph_node *cnode = cgraph_node::get (name);
+#ifdef ACCEL_COMPILER
+ /* For nvptx offloading, make sure to emit C++ constructor, destructor aliases [PR97106]
+
+ For some reason (yet to be analyzed), they're not 'cnode->referred_to_p ()'.
+ (..., or that's not the right approach at all;
+ <https://inbox.sourceware.org/87v7rx8lbx.fsf@euler.schwinge.ddns.net>
+ "Re: [committed][nvptx] Use .alias directive for mptx >= 6.3"). */
+ if (DECL_CXX_CONSTRUCTOR_P (name)
+ || DECL_CXX_DESTRUCTOR_P (name))
+ ;
+ else
+#endif
if (!cnode->referred_to_p ())
/* Prevent "Internal error: reference to deleted section". */
return;