https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97106
Bug ID: 97106 Summary: [nvptx] Issues with weak aliases introduced by C++ Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: vries at gcc dot gnu.org Depends on: 97102 Target Milestone: --- Created attachment 49240 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49240&action=edit C++ test case - note: matches mostly uncommitted testsuite/libgomp.c++/pr96390.C of PR96390 Related PR 97102: nvptx + aliases Related PR 96390: alias-related: automatically mark functions called in omp target as declare target (that's where the initial testcase came from) For the attached testcase, GCC calls the "complete object constructor" C1: _ZN1VILi1EEC1ImvEET_ but generates the function definition for "base object constructor" C2: _ZN1VILi1EEC2ImvEET_ And it generates a weak alias between the two. Using .alias should work – the aliasee should not be weak but I believe in our case only the alias itself is weak. – Hence, it should work. Caveat: .alias is ISA version 6.3 = CUDA 10.0, cf. PR 97102. I wonder whether this could be solved at LTO time – after all, except for linked libraries (libgomp, libm) it should be know. Caveat: currently, no real LTO is done on the offloading side. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97102 [Bug 97102] [nvptx] PTX JIT compilation failed when using aliases