https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119675
Bug ID: 119675 Summary: nvptx 'error: PTX does not support weak declarations (only weak definitions)' Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: testsuite-fail Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org CC: vries at gcc dot gnu.org Target Milestone: --- Target: nvptx Per Subversion r236990 (Git commit 721547cd0dd19a03a9e9405cfdbd6d0870eaaf68), <https://inbox.sourceware.org/b3571f8e-36da-5448-7bfa-8073af132...@acm.org> "[PTX] weak references", a number of nvptx target test cases fail due to nvptx-specific 'error: PTX does not support weak declarations (only weak definitions)'. The curious thing, though, is that GCN as per commit 2f58d8ac03911063d6a8887a2bee7b4e25ac1871 "GCN: Don't emit weak undefined symbols [PR119369]" also has issues with weak undefined symbols, and thus has their support disabled (but without the nvptx-specific error diagnostic cited above) -- and such test cases PASS, including their execution test. For example (random), libstdc++ '23_containers/multiset/modifiers/insert/insert_range.cc': GCN: PASS: 23_containers/multiset/modifiers/insert/insert_range.cc -std=gnu++23 (test for excess errors) PASS: 23_containers/multiset/modifiers/insert/insert_range.cc -std=gnu++23 execution test nvptx: In file included from [...]/build-gcc/nvptx-none/libstdc++-v3/include/algorithm:65, from [...]/source-gcc/libstdc++-v3/testsuite/23_containers/multiset/modifiers/insert/insert_range.cc:3: [...]/build-gcc/nvptx-none/libstdc++-v3/include/bits/ranges_algo.h:1838: error: PTX does not support weak declarations (only weak definitions) [...] FAIL: 23_containers/multiset/modifiers/insert/insert_range.cc -std=gnu++23 (test for excess errors) ..., which points to 'source-gcc/libstdc++-v3/include/bits/ranges_algo.h': [...] 42 #if __glibcxx_concepts 43 namespace std _GLIBCXX_VISIBILITY(default) 44 { 45 _GLIBCXX_BEGIN_NAMESPACE_VERSION 46 namespace ranges 47 { [...] 1838 inline constexpr __sort_fn sort{}; [...] What is GCN doing differently, and could nvptx do similarly?