<div dir="ltr"><span style="font-size:12.8000001907349px">Hi,</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">i have got some troubles while writing an X86 machine pass to instrumentate indirect calls . </span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Basically, every time i run into a CALL64r i would like to have this situation:</span><br style="font-size:12.8000001907349px"><font face="monospace, monospace" style="font-size:12.8000001907349px">                 ------<br>                | .... |<br>                | CMP  |</font><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                | JE   |</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                 ------</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                  |  |</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                ---  -----</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                |        |</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                ----    ---- </font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">               |EXIT|  |CALL|</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                ----   |....|</font></div><div style="font-size:12.8000001907349px"><font face="monospace, monospace">                        ----</font><br><font face="arial, helvetica, sans-serif">So i do a splice, fix up successors and predecessors, but since the call implicitly uses some register the compilation fails with a lot of this:<br><br>  *** Bad machine code: Using an undefined physical register ***</font></div><div style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif">- function:    foo</font></div><div style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif">- basic block: BB#126 (null) (0x6127658)</font></div><div style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif">- instruction: CALL64r %vreg41, <regmask>, %RSP<imp-use>, %EDI<imp-use>, %RSI<imp-use>, %RDX<imp-use>, %RCX<imp-use>, %R8<imp-use>, %R9D<imp-use>, %AL<imp-use>, %RSP<imp-def>, %EAX<imp-def>; GR64:%vreg41<br><br>How can i get rid of this errors?<br><br>Thank you very much,<br><br>-- Jon</font></div></div>