Internal error: unknown msize

I’ve run into an internal compiler error. Below is how to reproduce it.

Does anyone know what might be going wrong and how to fix it?

$ pgc++ --version

pgc++ 18.10-1 64-bit target on x86-64 Linux -tp sandybridge 
PGI Compilers and Tools
Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.

$ cat err.cc
#include <random>

int main() {
  std::random_device rd;

  std::minstd_rand0 engine(rd());

  std::uniform_real_distribution<float> dist(
      std::numeric_limits<float>::min(),
      std::nextafter(1.0, std::numeric_limits<float>::max()));

  dist(engine);

  #pragma acc kernels
  for (size_t i = 0; i < 1; ++i) {}
}

$ pgc++ -std=c++11 -ta=multicore -fast err.cc
PGCC-S-0000-Internal compiler error. memtype_dtype_match:unknown msize       3  (err.cc: 16)
PGCC-S-0000-Internal compiler error. memtype_dtype_match:unknown msize       3  (err.cc: 16)
PGCC-S-0000-Internal compiler error. memtype_dtype_match:unknown msize       3  (err.cc: 16)
PGCC-S-0000-Internal compiler error. memtype_dtype_match:unknown msize       3  (err.cc: 16)
PGCC-S-0000-Internal compiler error. memtype_dtype_match:unknown msize       3  (err.cc: 16)
PGCC/x86 Linux 18.10-1: compilation completed with severe errors

Hi amarinph,

This is a known compiler issue being tracked as TPR #26279 which unfortunately has not been fixed in a release as of yet. I’ve added your example code to this problem report.

The good news is that the error only occurs with our older non-LLVM compilers so you can work around the issue by adding “-Mllvm” to the compile, setting your PATH to use “$PGI/linux86-64-llvm/18.10/bin”, or updating the compilers to version 19.4 where LLVM is now the default.

Best Regards,
Mat

Example using the PGI LLVM based compilers:

% setenv PATH /proj/pgi/linux86-64-llvm/18.10/bin/:$PATH
% pgc++ --c++11 err.cc -fast -ta=multicore -V 

pgc++ 18.10-1 LLVM 64-bit target on x86-64 Linux -tp skylake
PGI Compilers and Tools
Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
Edison Design Group C/C++ Front End, version 4.14 (Oct 24 2018 12:51:27)
Copyright 1988-2017 Edison Design Group, Inc.

PGCC/x86-64 Linux 18.10-1
Copyright (c) 2017, NVIDIA CORPORATION.  All rights reserved.
%

I’ve updated the compiler to 19.4 and things are working as expected.

Thanks, Mat.