Nvc++ ICE on typical C++ snippet

I notice that around CMake 3.25, I could no longer compile CMake itself with nvc++ including version 23.1. Brad King of Kitware created a C++ snippet that triggers an ICE that’s similar to the new CMake internal code that nvc++ ICE’s on.

struct A { ~A(); };
template<typename T> struct X { X(int, T, A = A()); };
template<typename T> struct Y : public T { using T::T; };
struct S {
  X<double> x{1, 1.0};
  Y<X<double>> y{1, 1.0};
};
$ nvc++ --version
nvc++ 23.1-0 64-bit target on x86-64 Linux -tp skylake-avx512 
$ nvc++ -c broken-nvhpc.cpp 
Internal error: read_memory_region: not all expected entries were read

nvc++-Fatal-/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/bin/tools/cpp2 TERMINATED by signal 6
Arguments to /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/bin/tools/cpp2
/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/bin/tools/cpp2 broken-nvhpc.cpp -opt 1 -terse 1 -inform warn -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 skylake-avx512 -x 120 0x1000 -astype 0 -x 121 1 -fn broken-nvhpc.cpp -il /tmp/nvc++YkoEkwQxRk8qM.il -x 117 0x200 -x 123 0x80000000 -x 123 4 -x 119 0x20 -def __pgnu_vsn=80500 -x 70 0x40000000 -x 183 4 -x 121 0x800 -x 6 0x20000 -x 249 140 -x 120 0x200000 -x 70 0x40000000 -x 8 0x40000000 -x 164 0x800000 -x 71 0x2000 -x 71 0x4000 -x 34 0x40000000 -x 83 0x1 -x 85 0x1 -x 206 0x02 -x 120 0x1000000 -x 68 0x1 -x 39 4 -x 56 0x10 -x 26 0x10 -x 26 1 -x 56 0x4000 -x 197 0 -x 175 0 -x 203 0 -x 204 0 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -x 60 512 -gnuvsn 80500 -x 69 0x200 -x 123 0x400 -cmdline '+nvc++ /tmp/nvc++YkoEkwQxRk8qM.il ' -asm /tmp/nvc++skoEk2L8kC0J-.l

Thanks for the report mhirsch.

Looks like a regression that started in the 22.7 release. I’ve filed a problem report, TPR #33277, and sent it to our engineers for investigate.

-Mat

This is still broken with nvc++ 23.3

Correct and it will likely take a few months to get resolved. I’ll post a notification once a fix is available.

-Mat

Hi mhirsch,

TPR #33277 should be fixed in our 23.5 release.

% nvc++ -c test_ice.cpp -V23.3
Internal error: read_memory_region: not all expected entries were read

nvc++-Fatal-/proj/nv/Linux_x86_64/23.3/compilers/bin/tools/cpp2 TERMINATED by signal 6
Arguments to /proj/nv/Linux_x86_64/23.3/compilers/bin/tools/cpp2
...
% nvc++ -c test_ice.cpp -V23.5
%

-Mat

Thanks, that fix works and I can build CMake itself as well now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.