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

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
When still 'map'ping C++ 'typeinfo', 'vtable' at the OpenACC compute, OpenMP
'target' construct (as 'firstprivate', or 'map(to)'), there's an additional
issue.  With attachment 61052 altered as follows:

       {
         C1 c1;
    -    bool a = false;
    -    asm volatile ("" : : "r" (&a) : "memory");
    -    if (a)
    -      {
    -       [[maybe_unused]]
    -       C2 &c2 = dynamic_cast<C2 &>(c1);
    -      }
    +    C1 *c1p = &c1;
    +    asm volatile ("" : : "r" (&c1p) : "memory");
    +    C2 *c2 = dynamic_cast<C2 *>(c1p);
    +    if (c2)
    +      __builtin_abort();
       }

..., this should execute and terminate normally -- and it does, for host as
well as GCN, nvptx target execution.  But for GCN, nvptx offloading execution,
we get device-side SIGSEGV.

I suppose we have to properly (deep-)initialize the device-side data
structures?  Will this go away once we're no longer 'map'ping C++ 'typeinfo',
'vtable' at the OpenACC compute, OpenMP 'target' construct, or is additional
effort necessary?

Reply via email to