'Simple Register Coalescing' pass error

Hi all,
I have an error I do not understand. My program crashes during the 'Simple Register Coalescing' pass. All I know is that the crash happens inside LiveRange::Query() in llvm/include/llvm/CodeGen/LiveInterval.h and is due to the fact that EarlyVal is null and causes a crash when evaluating if (EarlyVal->def == Idx.getBaseIndex()). What could be the reason why EarlyVal is null? The function on which the pass is being run is:

void foo(uint8_t* input, const uint8_t* key, uint8_t *output, size_t len)

uint16_t np1 = (len * 8)/64;
uint16_t n = np1 - 1;
uint64_t A;
uint64_t R[n+1];
int i,j;

       for (i = 1; i<= n;i++)
           memcpy(&R[i], input + 8*i,8);

       for (j = 5; j >= 0; j--)
           for (i = n; i >= 1; i--)
            uint64_t l_input[2] =
              A ^ (((uint64_t)(n*j+i))<<56),

               dec((uint8_t*)l_input, key, output);

       int k;


Hi Josh,

That sounds like a bug, but I don’t have enough information to know what is going on.

Could you file a public report in buzgilla and attach the IR (run clang with -emit-llvm) and the debug output of the coalescer (-mllvm -debug-only=regalloc)?