I'm encountering a hard to understand crash moving to the 1.9.2 compiler in 
optimized code.

I have a struct:

struct Vec3f {
   float x;
   float y;
   float z;
};

The following code has worked fine under 1.9.1 and quite far back in both 
optimized and non-optimized builds and works fine in non-optimized 1.9.2:

const uniform uint8_t * varying ptr = ...; // input to function

const uniform Vec3f * varying v3fptr = (const uniform Vec3f * varying) ptr;
const Vec3f result = *v3fptr;  // gather

But under optimized 1.9.2, *v3fptr causes a segmentation violation.  The 
mask is not all-on and for sure some of the ptr values in the non-active 
lanes are invalid (not null, but definitely pointing to garbage).

If I re-write the code to manually gather, lane by lane:

Vec3f result;
foreach_active(lane) {
    const uniform uint8_t * uniform ptrU = (const uniform uint8_t * 
uniform) extract((varying intptr_t) ptr, lane);
    const uniform Vec3f resultU = *((const uniform Vec3f * uniform) ptrU);
    result.x = insert(result.x, lane, resultU.x);
    result.y = insert(result.y, lane, resultU.y);
    result.z = insert(result.z, lane, resultU.z);
}

the code completes without error.

I'm lead to think that the invalid pointers on the non-active lanes are 
being read and copied from, but I'm not sure.

These are the relevant compiler options:
--arch=x86-64
--opt=disable-assertions
-O3
--target=avx1-i32x8
--pic


The problem might be caused by issues elsewhere in our code.  I have not 
yet been able to reproduce the error with a simple, isolated example.  But 
I want to just throw this out there to see if anyone else has encountered 
something similar or if it rings any bells with anyone.

Cheers,
-Brian



-- 
You received this message because you are subscribed to the Google Groups 
"Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to