From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3BF0D3851C2C; Thu, 30 Jul 2020 12:53:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BF0D3851C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596113580; bh=6XdF+w45t4RIk+dmbX8MQ5ok6NgRboANWNKjD1mpyoU=; h=From:To:Subject:Date:From; b=It7rfxEbhzo4qWbA8kt7CG08kRF7lG9KelYTg++lT8dh5cf7uMiLge6uxzLLH/b9c gsS6pEWSp5fBh0OJ1KIFfv3hmsf+nb8BBUC2RAzhfC4KP67mNX2wnRFK+mxxr0EKbt 4dUeQi5N4Q+VhuhpqYX8ZlQ9tv/tl1XQdNoe8rjI= From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/96390] New: [OpenMP] Link errors on the offload side for C++ code with templates Date: Thu, 30 Jul 2020 12:53:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 12:53:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96390 Bug ID: 96390 Summary: [OpenMP] Link errors on the offload side for C++ code with templates Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- sollve_vv's tests/4.5/application_kernels/gemv_target_reduction.cpp fails to link when compiling with -O0. Note: with -O1 and higher, it becomes a host-only code, which works. Testcase: https://github.com/SOLLVE/sollve_vv/blob/master/tests/4.5/application_kerne= ls/alpaka_complex_template.cpp g++ -fopenmp alpaka_complex_template.cpp -O0 Namely, with GCN: ld: error: undefined symbol: S<0>::S() >>> referenced by /tmp/ccGooH3g.o:(main._omp_fn.2) >>> referenced by /tmp/ccGooH3g.o:(main._omp_fn.2) ld: error: undefined symbol: V<1>::V(unsigned long&&) >>> referenced by /tmp/ccGooH3g.o:(main._omp_fn.2) >>> referenced by /tmp/ccGooH3g.o:(main._omp_fn.2) And likewise with nvptx: libgomp: Link error log ptxas application ptx input, line 262; error : La= bel expected for argument 0 of instruction 'call' ptxas application ptx input, line 262; error : Function '_ZN1SILi0EEC1Ev'= not declared in this scope ptxas application ptx input, line 262; error : Call target not recognized ptxas application ptx input, line 276; error : Label expected for argumen= t 0 of instruction 'call' ptxas application ptx input, line 276; error : Function '_ZN1VILi1EEC1ImvEEOT_' not declared in this scope which demangles to the same symbols.=