ICE with RESHAPE, character array, zero-sized result


the following code crashes nvfortran-21.1:

program p
character(*), parameter :: a(0) = reshape([‘ab’], [0])

% nvfortran pr99206.f90
NVFORTRAN-W-0435-Array declared with zero size (pr99206.f90: 2)
nvfortran-Fatal-/work/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/bin/tools/fort1 TERMINATED by signal 11
Arguments to /work/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/bin/tools/fort1
/work/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/bin/tools/fort1 pr99206.f90 -opt 1 -terse 1 -inform warn -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp haswell -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -stdinc /work/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/include-gcc70:/work/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/include:/usr/lib64/gcc/x86_64-suse-linux/7/include:/usr/local/include:/usr/lib64/gcc/x86_64-suse-linux/7/include-fixed:/usr/lib64/gcc/x86_64-suse-linux/7/…/…/…/…/x86_64-suse-linux/include:/usr/include -cmdline '+nvfortran pr99206.f90 ’ -def unix -def __unix -def unix -def linux -def __linux -def linux -def __NO_MATH_INLINES -def LP64 -def __x86_64 -def x86_64 -def LONG_MAX=9223372036854775807L -def ‘SIZE_TYPE=unsigned long int’ -def ‘PTRDIFF_TYPE=long int’ -def __amd64 -def amd64 -def __k8 -def k8 -def MMX -def SSE -def SSE2 -def SSE3 -def SSSE3 -def SSE4_1 -def SSE4_2 -def AVX -def AVX2 -def FMA -def XSAVE -def POPCNT -def FXSR -def PGLLVM -def NVCOMPILER_LLVM -def extension= -freeform -vect 48 -x 54 1 -x 68 0x1 -x 70 0x40000000 -x 70 0x40000000 -x 68 0x1 -x 124 1 -x 195 0x8000 -y 163 0xc0000000 -x 189 0x10 -stbfile /tmp/nvfortran5ANeRN3kXP0F.stb -modexport /tmp/nvfortranbANedLucqYpt.cmod -modindex /tmp/nvfortranjANeBnz5n1zg.cmdx -cci /tmp/nvfortranXANet9xZfPvQ.cci -output /tmp/nvfortranPANe7ngQi3Gz.ilm

Thanks anlauf! I was able to reproduce the issue here so filled a problem report, TPR #29639, and sent it to engineering for further investigation.