public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/97102] New: [nvptx] PTX JIT compilation failed when using aliases
@ 2020-09-18  7:15 burnus at gcc dot gnu.org
  2020-09-18  8:04 ` [Bug target/97102] " burnus at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-09-18  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97102
           Summary: [nvptx] PTX JIT compilation failed when using aliases
           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
  Target Milestone: ---

[Found when testing a patch for PR96390, which works with GCN offloading but
not with nvptx]

When compiling the following with -fopenmp
--------------------------------------
#pragma omp declare target
int foo () { return 42; }
int bar () __attribute__((alias ("foo")));
#pragma omp end declare target

int
main ()
{
  int n;
  #pragma omp target map(from:n)
    n = bar ();
  if (n != 42)
    __builtin_abort ();
}
--------------------------------------

it fails with when running with:

libgomp: Link error log ptxas application ptx input, line 89; error   : Label
expected for argument 0 of instruction 'call'
ptxas application ptx input, line 89; fatal   : Call target not recognized
ptxas fatal   : Ptx assembly aborted due to errors

libgomp: cuLinkAddData (ptx_code) error: a PTX JIT compilation failed


The generated PTX has:
------------
// BEGIN GLOBAL FUNCTION DECL: foo
.visible .func (.param.u32 %value_out) foo;

// BEGIN GLOBAL FUNCTION DEF: foo
.visible .func (.param.u32 %value_out) foo
{
        .reg.u32 %value;
        .reg.u32 %r22;
        .reg.u32 %r23;
                mov.u32 %r22, 42;
                mov.u32 %r23, %r22;
                mov.u32 %value, %r23;
        st.param.u32    [%value_out], %value;
        ret;
}
...
call (%value_in), bar;
------

Namely: 'bar' only appears in the call.

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

end of thread, other threads:[~2022-09-07  8:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18  7:15 [Bug target/97102] New: [nvptx] PTX JIT compilation failed when using aliases burnus at gcc dot gnu.org
2020-09-18  8:04 ` [Bug target/97102] " burnus at gcc dot gnu.org
2020-09-18 10:27 ` burnus at gcc dot gnu.org
2020-09-18 10:42 ` burnus at gcc dot gnu.org
2020-09-22  6:10 ` vries at gcc dot gnu.org
2020-09-22  7:18 ` vries at gcc dot gnu.org
2020-09-22  8:09 ` vries at gcc dot gnu.org
2020-09-23  7:25 ` vries at gcc dot gnu.org
2020-09-23  7:31 ` vries at gcc dot gnu.org
2021-05-12 16:39 ` vries at gcc dot gnu.org
2022-03-22 13:59 ` vries at gcc dot gnu.org
2022-09-07  8:02 ` 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).