Multiply defined local value in llvm code generated by -O2

The following will not compile with -Mcuda=llvm and -O2, but does compile with -O1.

subroutine evolve_potl(u,d,potl)
implicit none
integer, parameter :: mx=1024
complex*16, parameter :: im = (0d0,1d0)
complex*16, device, dimension(mx) :: u, d
real*8, device, dimension(mx) :: potl
complex*16 spin
integer i
!$cuf kernel do(1) <<< (*), (*) >>>
do i=1,mx
   spin=exp(im*potl(i))
   u(i)=u(i)*spin
   d(i)=d(i)*spin
enddo
return
end

The error messages are

nvvmCompileProgram error: 9.
Error: PGI-14.1-potl-bug-1D.n001.gpu (145, 4): parse error: multiple definition of local value named ‘li77’
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (PGI-14.1-potl-bug-1D.f90: 1)
PGF90/x86-64 Linux 14.1-0: compilation aborted

Thanks Paul. I’ve added a problem report (TPR#19863) and forwarded it on to engineering. Hopefully we can get this fixed in 14.3.

  • Mat

TPR 19863 - CUF: User code gets mulitple defined references when compiling -O2 -Mcuda=llvm

has been fixed in the current 14.3

thanks,
dave