reg2mem breaks module

Hello,

I’m trying to apply the reg2mem pass on my bc file, but it somehow adds an instruction before a landingpad instruction and so I get a broken module error:

The unwind destination does not have a landingpad instruction!

%41 = invoke %class.x* @_ZN10xC2Ev(%class.x* %.reload19)

to label %.noexc unwind label %88

The unwind destination does not have a landingpad instruction!

I tried it on LLVM-3.1 and LLVM-3.2, and the same issue occurs on both.

Is there a known bug with reg2mem?

Maybe I’m doing something wrong?

Thanks!

Alon

Hi Alon, does your module pass the verifier?
   opt -disable-output -verify pass.bc
If it does, please open a bug report.

Ciao, Duncan.