<div dir="ltr">Dear LLVMers, <div><br></div><div>I'm working on the openrisc backend which is not currently upstreamed, I want to use llvm as the compiler and linking with gcc/g++. I have a simple test program below, right now if I run the compiled binary, it hangs and never returned to the catch block. If I throw exception directly in the try block instead of in another function, it works fine. </div><div><br></div><div>I've looked at the generated assembly instructions and they all look right to me, except for the generated exception table which I don't know enough to tell whether it's right or nor, my first guess is that maybe there is some compatibility issue for the exception table between llvm and g++, so I try to manually modify according to that generated by g++,  but the bug is still there. </div><div><br></div><div>I wonder how should I approach this issue, is there anything in the backend that could cause the bug ?</div><div><br></div><div>I attached the assembly in case anyone wants to take a closer look.</div><div><br></div><div>Any suggestion is greatly appreciated.</div><div>Patrick</div><div><br></div><div><br></div><div><div>#include <stdlib.h></div><div>#include <stdio.h></div><div><br></div><div>void foo(int a) {</div><div>  throw -15;</div><div>}</div><div><br></div><div>int main() {</div><div>  int error = 0;</div><div>  try {</div><div>    foo(0);                                                                         </div><div>  }</div><div>  catch (int e) {</div><div>    error = e;</div><div>  }</div><div>  printf("Error = %d\n", error);</div><div>  return 0;</div><div>}</div></div><div><br></div><br clear="all"><div><br></div><br><div class="gmail_signature"><div dir="ltr"><div><b></b></div></div></div></div>