[llvm-dev] 'Simple Register Coalescing' pass error
Josh Sharp via llvm-dev
llvm-dev at lists.llvm.org
Thu Apr 11 21:32:34 PDT 2019
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;
memcpy(&A,input,8);
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),
R[i]
};
dec((uint8_t*)l_input, key, output);
memcpy(&A,output,8);
memcpy(&R[i],output+8,8);
}
memcpy(output,&A,8);
int k;
for(k=1;k<(n+1);k++)
{
memcpy(output+8*k,&R[k],8);
}
}
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190412/ca27d61e/attachment.html>
More information about the llvm-dev
mailing list