public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/96390] New: [OpenMP] Link errors on the offload side for C++ code with templates
@ 2020-07-30 12:53 burnus at gcc dot gnu.org
  2020-07-30 13:02 ` [Bug middle-end/96390] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-07-30 12:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96390

            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_kernels/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, void>(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   : Label
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 argument 0
of instruction 'call'
ptxas application ptx input, line 276; error   : Function
'_ZN1VILi1EEC1ImvEEOT_' not declared in this scope

which demangles to the same symbols.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-28 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 12:53 [Bug middle-end/96390] New: [OpenMP] Link errors on the offload side for C++ code with templates burnus at gcc dot gnu.org
2020-07-30 13:02 ` [Bug middle-end/96390] " burnus at gcc dot gnu.org
2020-07-31 12:28 ` burnus at gcc dot gnu.org
2020-07-31 14:52 ` burnus at gcc dot gnu.org
2020-09-28 16:08 ` cvs-commit at gcc dot gnu.org
2020-09-28 16:44 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).