llvm seg fault when specifying addRequiredTransitive in module pass

Hi all,

I am using llvm to perform some static analysis with a module pass. In getAnalysisUsage(), I specified some required passes by:

addRequiredTransitive();

When I run my pass using opt, it crashes with segmentation fault with callstack:

#0 0x0877aebd in llvm::PMTopLevelManager::findAnalysisUsage (this=0x8c10934, P=0xb15b988) at PassManager.cpp:573
#1 0x0877aa9b in llvm::PMTopLevelManager::setLastUser (this=0x8c10934, AnalysisPasses=…, P=0xb121c18) at PassManager.cpp:512
#2 0x0877ee0f in llvm::MPPassManager::addLowerLevelRequiredPass (this=0x8c102d8, P=0xb121c18, RequiredPass=0xb15b988) at PassManager.cpp:162
5
#3 0x0877ca44 in llvm::PMDataManager::add (this=0x8c102e8, P=0xb121c18, ProcessAnalysis=true) at PassManager.cpp:1014
#4 0x0877f549 in llvm::ModulePass::assignPassManager (this=0xb121c18, PMS=…, PreferredType=llvm::PMT_ModulePassManager) at PassManager.cpp
:1782
#5 0x0877b339 in llvm::PMTopLevelManager::schedulePass (this=0x99ce80c, P=0xb121c18) at PassManager.cpp:655
#6 0x08780ab6 in llvm::PassManagerImpl::add (this=0x99ce738, P=0xb121c18) at PassManager.cpp:387
#7 0x0877f0bf in llvm::PassManager::add (this=0xbfffefc8, P=0xb121c18) at PassManager.cpp:1680
#8 0x082c6ad7 in addPass (PM=…, P=0xb121c18) at opt.cpp:397
#9 0x082c79c1 in main (argc=5, argv=0xbffff0f4) at opt.cpp:636

I am using the llvm just checked out from svn. It is configured with Debug and Asserts enabled. I tried to use setPrevervesAll() and the seg fault still exists. I also tried to require other passes such as DominatorTree and it also crashes.

I found a similar bug at http://llvm.org/bugs/show_bug.cgi?id=9550. However since I just checked out from svn, I believe the patch is already there.

Could any one help on this issue? Any instructions or walk around is greatly appreciated.

Thanks very much.