public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/105076] New: [OpenMP] Weak/template functions: split-off offload-region functions should also be weak
@ 2022-03-28  8:06 burnus at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: burnus at gcc dot gnu.org @ 2022-03-28  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105076
           Summary: [OpenMP] Weak/template functions: split-off
                    offload-region functions should also be weak
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

When using something like

template<T>
void foo(T var)
{
  #pragma omp target ...
    ...
}

the function 'foo' is weak – but its associated offload function isn't.

Result: While at the end only one 'foo' function remains, there will be as many
offload function as 'foo'-using translation units.

Expected: Also the split off target-regions should be a weak symbol.

NOTE: Requires a consistent naming of the offload functions, but I think that's
already guaranteed by create_omp_child_function_name (invoked from
create_omp_child_function_name).

Existing testcase:
  'test_map' in libgomp/testsuite/libgomp.c++/target-same-name-2.C
   of PR104285 / r12-7776-g1002a7ace11
   (checks only for link/run-time errors and not for how many offload functions
remain)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-28  8:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28  8:06 [Bug middle-end/105076] New: [OpenMP] Weak/template functions: split-off offload-region functions should also be weak 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).