Segfault on SSE intrinsic code

Hi, the following very simple code segfaults in the kraken supercomputer. Compiled with:
“pgcc sse_test.c”
pgcc version:
pgcc 11.9-0 64-bit target on x86-64 Linux -tp k8e

sse_test.c:

#include <stdio.h>
#include <math.h>

#ifdef SSE2
#include <emmintrin.h>
#endif
#if defined(__INTEL_COMPILER) && !defined(SSE3)
#define SSE3
#endif
#ifdef SSE3
#include <pmmintrin.h>
#endif

/*
Only difference between test_crash and test_ok is the location of the input parameter q1
*/

void test_crash(__m128d dx2, __m128d dy2, __m128d dz2, __m128d rsq2,
__m128d dx3, __m128d dy3, __m128d dz3, __m128d rsq3,
double *pftable,
double *forcexjj0, double *forceyjj0, double *forcezjj0,
double *forcexjj1, double *forceyjj1, double *forcezjj1,
__m128d q1
) {

printf(“test_crash, Here (1)\n”);

__m128d ep1 = _mm_set1_pd(1.0);

printf(“test_crash, Here (2)\n”);

__m128d coulpotd = _mm_mul_pd(q1, ep1);

printf(“test_crash, Here (3)\n”);

return;

}

void test_ok(__m128d dx2, __m128d dy2, __m128d dz2, __m128d rsq2,
__m128d dx3, __m128d dy3, __m128d dz3, __m128d rsq3,
double *pftable,
double *forcexjj0, double *forceyjj0, double *forcezjj0,
__m128d q1,
double *forcexjj1, double *forceyjj1, double *forcezjj1
) {

printf(“test_ok, Here (1)\n”);

__m128d ep1 = _mm_set1_pd(1.0);

printf(“test_ok, Here (2)\n”);

__m128d coulpotd = _mm_mul_pd(q1, ep1);

printf(“test_ok, Here (3)\n”);

return;

}


int main() {
double forcex;
double pftable;

__m128d dx2 = _mm_set1_pd(0.0);
__m128d dy2 = _mm_set1_pd(0.0);
__m128d dz2 = _mm_set1_pd(0.0);
__m128d rsq2 = _mm_set1_pd(0.0);

__m128d dx3 = _mm_set1_pd(0.0);
__m128d dy3 = _mm_set1_pd(0.0);
__m128d dz3 = _mm_set1_pd(0.0);
__m128d rsq3 = _mm_set1_pd(0.0);

__m128d qOOd = _mm_set1_pd(0.0);

test_ok(dx2, dy2, dz2, rsq2,
dx3, dy3, dz3, rsq3,
&pftable,
&forcex, &forcex, &forcex,
qOOd,
&forcex, &forcex, &forcex
);

test_crash(dx2, dy2, dz2, rsq2,
dx3, dy3, dz3, rsq3,
&pftable,
&forcex, &forcex, &forcex,
&forcex, &forcex, &forcex,
qOOd
);


return 1;
}

Hi Antti-Pekka Hynninen,

Thanks for the report. I’ve sent this on to our compiler engineers (TPR#18880) since I’m not sure why this is failing. Though, it does seem like a compiler issue.

Best Regards,
Mat

TPR 18880 - User code using m128 sse intrinsics gets segv in 11.10 and ICE in 12.x and dev

was fixed in the 12.10 release last October.

thanks,
dave