https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118841
Bug ID: 118841
Summary: please do not use long double in generate_canonical
when the range is small enough
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: woodard at redhat dot com
Target Milestone: ---
This small test program:
#include <random>
#define N 4000
int main(){
float A[N], B[N], C[N];
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_real_distribution<float> dis(0.0f, 1.0f);
#pragma omp target
for( int i=0; i<N;i++) {
A[i] = dis(gen);
B[i] = dis(gen);
C[i]=A[i]+B[i];
}
}
fails with:
$ g++ -fopenmp 3-3.C
lto1: fatal error: amdgcn-amdhsa - 80-bit-precision floating-point numbers
unsupported (mode ‘XF’)
compilation terminated.
gcn mkoffload: fatal error: x86_64-redhat-linux-accel-amdgcn-amdhsa-gcc
returned 1 exit status
compilation terminated.
lto-wrapper: fatal error:
/usr/libexec/gcc/x86_64-redhat-linux/14//accel/amdgcn-amdhsa/mkoffload returned
1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
evidently this is caused by generate_canonical making use of long double in its
implementation. Can this be changed to using normal precision doubles when the
range is sufficiently narrow much like was done in
https://gcc.gnu.org/r11-4588-g60d9f254876a00