nvptx: Use the usual '#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)'
commit9837f62f066db532c9db6df38ccf2653d0c3a960
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 14 Jul 2022 21:22:35 +0000 (14 23:22 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Mon, 6 Nov 2023 14:47:22 +0000 (6 15:47 +0100)
tree0aeb5f7d05d4deebd002629647a6bd85031b8297
parent9125969086bfa1bf804b246ea574a2329b06d2c5
nvptx: Use the usual '#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)'

With this 'MAKE_DECL_ONE_ONLY' definition, we get 'SUPPORTS_ONE_ONLY', and thus
'__GXX_WEAK__', and thus '__GXX_TYPEINFO_EQUALITY_INLINE'.  This unblocks build
of 'libstdc++-v3/libsupc++/tinfo.cc', which otherwise depends on symbol alias
support, which GCC/nvptx doesn't generally provide.  Also, this gets us a
number of FAIL -> PASS progressions in the test suite.

Given that GCC/nvptx support for weak symbols isn't complete, we also get a few
more of the already-known
'error: PTX does not support weak declarations (only weak definitions)':

    [-PASS:-]{+FAIL:+} g++.old-deja/g++.other/crash11.C  -std=c++14 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.other/crash11.C  -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.other/crash11.C  -std=c++20 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.other/crash11.C  -std=c++98 (test for excess errors)

    [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/crash29.C  -std=c++14 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/crash29.C  -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/crash29.C  -std=c++20 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/crash29.C  -std=c++98 (test for excess errors)

    [-PASS:-]{+FAIL:+} 23_containers/map/56613.cc  -std=gnu++17 (test for excess errors)

... as well as one more of the already-known
'sorry, unimplemented: target cannot support nonlocal goto':

    PASS: g++.dg/tree-ssa/pr22488.C  -std=gnu++14 (test for excess errors)
    PASS: g++.dg/tree-ssa/pr22488.C  -std=gnu++17 (test for excess errors)
    PASS: g++.dg/tree-ssa/pr22488.C  -std=gnu++20 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/tree-ssa/pr22488.C  -std=gnu++98 (test for excess errors)

We shall look into these, later.

gcc/
* config/nvptx/nvptx.h (MAKE_DECL_ONE_ONLY): Define.
gcc/config/nvptx/nvptx.h