<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div>
<div id="divRplyFwdMsg" dir="ltr">
<div> </div>
</div>
<div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi all,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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 <span>if (EarlyVal->def == Idx.getBaseIndex()). <span style="font-family:Calibri,Helvetica,sans-serif">
What could be the reason why EarlyVal is null?</span></span><span style="font-family:Calibri,Helvetica,sans-serif">
</span><span>The function on which the pass is being run is:</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span></span><span></span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Courier New",monospace">void foo(uint8_t* input, const uint8_t* key, uint8_t *output, size_t len)</span><span><br>
</span>
<div><span style="font-family:"Courier New",monospace">{</span><br>
</div>
<br>
<blockquote style="margin-top:0px; margin-bottom:0px">
<blockquote style="margin-top:0px; margin-bottom:0px">
<div><span style="font-family:"Courier New",monospace">uint16_t np1 = (len * 8)/64;</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">uint16_t n = np1 - 1;</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">uint64_t A;</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">uint64_t R[n+1];</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">int i,j;</span><br>
</div>
</blockquote>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">       memcpy(&A,input,8);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       for (i = 1; i<= n;i++)</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       {</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">           memcpy(&R[i], input + 8*i,8);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       }</span><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">       for (j = 5; j >= 0; j--)</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">           for (i = n; i >= 1; i--)</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">           {</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">            uint64_t l_input[2] =</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">            {</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">              A ^ (((uint64_t)(n*j+i))<<56),</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">              R[i]</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">            };</span><br>
</div>
<br>
<div><span style="font-family:"Courier New",monospace">               dec((uint8_t*)l_input, key, output);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">               memcpy(&A,output,8);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">               memcpy(&R[i],output+8,8);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">           }</span><br>
</div>
<br>
<div><span style="font-family:"Courier New",monospace">       memcpy(output,&A,8);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       int k;</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       for(k=1;k<(n+1);k++)</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       {</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">        memcpy(output+8*k,&R[k],8);</span><br>
</div>
<div><span style="font-family:"Courier New",monospace">       }</span><br>
</div>
<span style="font-family:"Courier New",monospace">}</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Courier New",monospace"><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks.<br>
</div>
</div>
</div>
</body>
</html>