[LLVMbugs] [Bug 6571] New: Crash when turning on RTTI and writing your own alias pass using multiple inheritence

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 10 09:30:31 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=6571

           Summary: Crash when turning on RTTI and writing your own alias
                    pass using multiple inheritence
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ddneff at hotmail.com
                CC: llvmbugs at cs.uiuc.edu


I compiled llvm using REQUIRES_RTTI=1 with gcc 4.3.2 on 64 bit linux and
statically linked it into my program.  I have my own alias pass that looks like
this:

class TypeBasedAliasAnalysis 
        : public llvm::ModulePass
        , public llvm::AliasAnalysis
{
    public:
        TypeBasedAliasAnalysis() : ModulePass(&ID) {}
        static char ID;

        virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
        virtual bool runOnModule(llvm::Module& module);

        llvm::AliasAnalysis::AliasResult 
        alias(const llvm::Value *V1, unsigned V1Size,
              const llvm::Value *V2, unsigned V2Size);

        ...
}

It has no other data members and a few other non virtual functions.  When I try
to use this pass, it ends up calling the wrong function when it tries to call
alias in AliasAnalysis::getModRefInfo(StoreInst *s, Value* P, unsigned Size).
It ends up calling the Print function of the raw stream class, and bad things
result.  My other passes that use single inheritence seem to work correctly.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list