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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 49252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49252&action=edit
Other draft patch

I started out independently, and converged to roughly the same code.

One thing I came across during standalone testing is that the alias support in
gcc is for symbols, and as such supports functions and variables, but the ptx
support is only there for functions.  I handle this in the patch with an error,
but it causes quite a few failures:
...
src/gcc/testsuite/gcc.c-torture/execute/alias-2.c:3:12: error: non-function
alias definitions not supported in this configuration^M
compiler exited with status 1
FAIL: gcc.c-torture/execute/alias-2.c   -O0  (test for excess errors)
...
So, that would probably need to be handled by separate effective targets
alias_var/alias_fn.

With standalone testing we also run into various problems related to bumping
the ISA, see also PR96005.

As for libgomp testing, I've tried the test reported in this PR, and got this
ptx link error (silent with trunk, needed to add some printing in plugin):
...
Internal error: reference to deleted section
...

By dumping the ptx code using GOMP_NVPTX_PTXRW and compiling it using ptxas, it
becomes clear that the most complained about problem is deprecated shfl:
...
ptxas gomp-nvptx.11.ptx, line 117; warning : Instruction 'shfl' without '.sync'
is deprecated since PTX ISA version 6.0 and will be discontinued in a future
PTX ISA version
...

The internal error is a driver problem, but it's possible that we push the
driver into a corner by using deprecated insns alongside with modern constructs
like .alias.

So, it seems sensible to do the porting to newer ISA (PR96005) first, before
trying to enable .alias.

Reply via email to