<div dir="ltr">I don't know which pass it is, but have you tried dumping the final IR to see whether that IR still contains the right code?<div><br></div><div>You can do that using opt to do the optimization. You can also use -print-after or -print-after-all to see the IR after each pass.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 26, 2014 at 10:51 AM, Rinaldini Julien <span dir="ltr"><<a href="mailto:julien.rinaldini@heig-vd.ch" target="_blank">julien.rinaldini@heig-vd.ch</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm writing a pass that implements a jump table with an array of<br>
blockaddress and an indirectbr instruction.<br>
<br>
It get a blockaddress in the array (via getelementptr and an index) and<br>
then jump to this basicblock via the indirectbr.<br>
<br>
I tried to compile several libraries to test my pass and the run their<br>
test-suite. It works fine with, for e.g, libTomCrypt (in -O0,1,2,3).<br>
With GMP or ImageMagick it works fine in -O0, but whenever I try in<br>
-O1,2,3 it fail and I get a tons of errors like (note that the<br>
compilation/link of the libs itself works, it fails when I make a 'make<br>
check'):<br>
<br>
...<br>
./.libs/libtests.a(misc.o):(.rodata+0x5b0): undefined reference to<br>
`.Ltmp491'<br>
./.libs/libtests.a(misc.o):(.rodata+0x5b8): undefined reference to<br>
`.Ltmp492'<br>
./.libs/libtests.a(misc.o):(.rodata+0x5c0): undefined reference to<br>
`.Ltmp493'<br>
./.libs/libtests.a(misc.o):(.rodata+0x5c8): undefined reference to<br>
`.Ltmp494'<br>
...<br>
<br>
I tried to modify my pass, call my pass in the PassManagerBuilder at<br>
different places,... But I still got the same errors each time.<br>
<br>
I ran out of ideas where to look :( I got this problem both on Linux and<br>
OSX.<br>
<br>
Any idea which pass could cause this problem ? Maybe it's a pass in the<br>
backend ?<br>
<br>
Cheers !<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>