Nvfortran

nvfortran (I am using 20.7 on Ubuntu 18.04) stumbles over the following bind(C) code:
function cpp_str_get () bind (C) result (c)
use iso_c_binding
character(c_char) :: c
c = achar (0)
end function cpp_str_get
nvfortran-Fatal-/scratch/reuter/local/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/tools/fort2 TERMINATED by signal 11
Arguments to /scratch/reuter/local/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/tools/fort2
/scratch/reuter/local/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/tools/fort2 /tmp/nvfortranIlFfMbAMs49n.ilm -fn CppStringsWrap_dummy.f90 -opt 1 -terse 1 -inform warn -x 51 0x20 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp haswell -x 120 0x1000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -astype 0 -x 183 4 -x 121 0x800 -x 68 0x1 -x 8 0x40000000 -x 70 0x40000000 -x 56 0x10 -x 54 0x10 -x 249 90 -x 68 0x20 -x 70 0x40000000 -x 8 0x40000000 -x 164 0x800000 -x 85 0x2000 -x 85 0x4000 -x 68 0x1 -x 39 4 -x 56 0x10 -x 124 1 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -cmdline ā€˜+nvfortran CppStringsWrap_dummy.f90 -cā€™ -stbfile /tmp/nvfortranYlFfwoQY_xn8.stb -asm /tmp/nvfortranYlFfwDO_zElq.ll

Alternatively, when defining the code in the following way:
function cpp_str_get (str, i) bind (C) result (c)
use iso_c_binding
type(c_ptr), intent(in), value :: str
integer(c_int), intent(in), value :: i
character(c_char) :: c
c = achar (0)
end function cpp_str_get

nvfortran issues:
/scratch/reuter/local/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/share/llvm/bin/llc: error: /scratch/reuter/local/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/share/llvm/bin/llc: /tmp/nvfortrannLGfNYKJUN8q.ll:8:2: error: multiple definition of local value named ā€˜c_300ā€™
%c_300 = alloca [1 x i8], align 4
^

Thanks Juergen. I was able to reproduce both issues. While related, I filed these as two different issue, TPR#29141 for the fort2 segv, and TPR#29142 for the LLVM code generation issue.

Best Regards,
Mat

1 Like