]> git.ipfire.org Git - thirdparty/gcc.git/commit
nvptx: Emit DECL and DEF linker markers for aliases [PR104957]
authorThomas Schwinge <tschwinge@baylibre.com>
Wed, 17 Jul 2024 21:56:25 +0000 (23:56 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Thu, 5 Sep 2024 12:28:39 +0000 (14:28 +0200)
commit8f5aade15e595b288a2c4ec60ddde8dc80df1a80
tree5f910d7d047109bf49b204ed26acb3e13f3366c7
parenta1865fd33897bc6c6e0109df0a12ee73ce386315
nvptx: Emit DECL and DEF linker markers for aliases [PR104957]

With nvptx '-malias' enabled (as implemented in
commit f8b15e177155960017ac0c5daef8780d1127f91c
"[nvptx] Use .alias directive for mptx >= 6.3"), the C++ front end in certain
cases does 'write_fn_proto' before an eventual 'alias' attribute has been
added.  In that case, we do emit (via 'write_fn_marker') a DECL linker marker,
but then never emit a corresponding DEF linker marker for the alias.  This
causes hundreds of instances of link-time 'unresolved symbol [alias]' across
the C++ test suite, which are regressions compared to a test run with (default)
'-mno-alias' (in which case the respective functions get duplicated).

PR target/104957
gcc/
* config/nvptx/nvptx.cc (write_fn_proto_1): Revert 2022-03-22
change; 'write_fn_marker' also for alias DECL.
(nvptx_asm_output_def_from_decls): 'write_fn_marker' for alias
DEF.
gcc/testsuite/
* g++.target/nvptx/alias-g++.dg_init_dtor2-1.C: Un-XFAIL.
* gcc.target/nvptx/alias-1.c: Likewise.
* gcc.target/nvptx/alias-3.c: Likewise.
* gcc.target/nvptx/alias-to-alias-1.c: Likewise.
gcc/config/nvptx/nvptx.cc
gcc/testsuite/g++.target/nvptx/alias-g++.dg_init_dtor2-1.C
gcc/testsuite/gcc.target/nvptx/alias-1.c
gcc/testsuite/gcc.target/nvptx/alias-3.c
gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c