<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On Sep 19, 2007, at 4:48 PM, Bill Wendling wrote:</div><br><blockquote type="cite">Hi all,<br><br>This program:<br><br>@protocol CPTransferThreadObserving;<br><br>@interface CPMode {}<br>@end<br><br>@implementation CPMode<br>-(void) copyInBackgroundAndNotifyUsingPorts {<br>  id client;<br>  [client setProtocolForProxy:<br>            @protocol(CPTransferThreadObserving)];<br>}<br>@end<br><br>produces this internal compiler error:<br><br>$ llvm-gcc -x objective-c -arch ppc64 -std=c99 -c testcase.mi<br>testcase.mi:12: internal compiler error: Bus error<br>Please submit a full bug report,<br>with preprocessed source if appropriate.<br>See <URL:<a href="http://llvm.org/bugs">http://llvm.org/bugs</a>> for instructions.<br></blockquote></div><br><div>In llvm-backend.cpp  :</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">1086</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">      </font></span><font class="Apple-style-span" face="Courier">        if (GV->getName() != Name) {</font></div><div><font class="Apple-style-span" face="Courier">1087</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">       </font></span><font class="Apple-style-span" face="Courier">          Function *F = TheModule->getFunction(Name);</font></div><div><font class="Apple-style-span" face="Courier">1088</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier"> </font></span><font class="Apple-style-span" face="Courier">          assert(F && F->isDeclaration() && "A function turned into a global?");</font></div><div><font class="Apple-style-span" face="Courier">1089</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">    </font></span><font class="Apple-style-span" face="Courier">          </font></div><div><font class="Apple-style-span" face="Courier">1090</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">       </font></span><font class="Apple-style-span" face="Courier">          // Replace any uses of "F" with uses of GV.</font></div><div><font class="Apple-style-span" face="Courier">1091</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">  </font></span><font class="Apple-style-span" face="Courier">          Value *FInNewType = ConstantExpr::getBitCast(GV, F->getType());</font></div><br><br class="webkit-block-placeholder"></div><div><div>(gdb) p Name</div><div>$3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving"</div><br>However  <font class="Apple-style-span" face="Courier">TheModule->getFunction(Name)</font> returns NULL and you get ICE at <font class="Apple-style-span" face="Courier">F->getType(</font>) #1091. I'll let you investigate this further ...   :)</div><div> </div><div><br class="webkit-block-placeholder"></div><div>-</div><div>Devang</div><div><br class="webkit-block-placeholder"></div></body></html>