https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104957
--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Thomas Schwinge <tschwi...@gcc.gnu.org>: https://gcc.gnu.org/g:8f5aade15e595b288a2c4ec60ddde8dc80df1a80 commit r15-3487-g8f5aade15e595b288a2c4ec60ddde8dc80df1a80 Author: Thomas Schwinge <tschwi...@baylibre.com> Date: Wed Jul 17 23:56:25 2024 +0200 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.