[LLVMbugs] [Bug 5827] New: clang generates bogus unwind code for indirect function call

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Dec 18 03:03:40 PST 2009


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

           Summary: clang generates bogus unwind code for indirect function
                    call
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nunoplopes at sapo.pt
                CC: llvmbugs at cs.uiuc.edu


$ cat a.cpp
typedef int int64_t __attribute__ ((__mode__ (__DI__)));
typedef int64_t UTextMapOffsetToNative();

class RuleBasedBreakIterator  {
  UTextMapOffsetToNative *mapOffsetToNative;
  int checkDictionary(int x);
};

class UStack {
public:
  UStack(int);
  virtual ~UStack();
};

int RuleBasedBreakIterator::checkDictionary(int x) {
  UStack breaks(0);
  return (int)(x ? 0 : mapOffsetToNative());
}


$ clang -S -emit-llvm -o - a.cpp | llc -o a.o
(ok)

$ clang -O2 -S -emit-llvm -o - a.cpp | llc -o a.o
Invoke result does not dominate all uses!
  %call = invoke i64 %tmp5()
          to label %cond.end unwind label %ehcleanup ; <i64> [#uses=1]
  %extract.t = trunc i64 %call to i32             ; <i32> [#uses=1]
Broken module found, compilation aborted!
Stack dump:
0.      Program arguments: llc -o a.o
1.      Running pass 'Module Verifier' on function
'@_ZN22RuleBasedBreakIterator15checkDictionaryEi'                               
Aborted


the weird part:

$ clang -S -emit-llvm -o - a.cpp | opt -std-compile-opts | llc -O2 -o a.o
(ok)

$ clang -O2 -c -o - a.cpp
clang: SelectionDAGBuilder.cpp:706: llvm::SDValue
llvm::SelectionDAGBuilder::getValue(const llvm::Value*): Assertion `InReg &&
"Value not in map!"' failed.
Stack dump:
2.      Code generation
3.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_ZN22RuleBasedBreakIterator15checkDictionaryEi


Is clang running any optimization pass at -O2 that is not included in opt
-std-compile-opts? If not, there's something weird going on..


-- 
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