<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p> </p>
<p>I got that message from a call to InstrEmitter::AddOperand. I am writing a back end for CortexM0 (for self teaching purposes), I am working on LDR with immediate offset instruction.</p>
<p>In the ARM backend,  if the offset is 0, the following code is executed by the function ARMDAGToDAGISel::SelectThumbAddrModeImm5S</p>
<p>Base = N.getOperand(0);<br />OffImm = CurDAG->getTargetConstant(0, MVT::i32);</p>
<p>If I do a similar thing in my backend, I get this assertion message. I found out that if I execute the code below, the problem disappear.   </p>
<p>Base = N;<br />OffImm = CurDAG->getTargetConstant(0, TM.getTargetLowering()->getPointerTy());  </p>
<p>Only the change for Base seems relevant to the error though.</p>
<p>Could someone give me some pointers to understand what's going on. For example, something to read about what is "chain & glue".</p>
<p> </p>
<p>Cheers,</p>
<p>Sebastien</p>
<p> </p>
<p> </p>
<div> </div>
</body></html>