[LLVMbugs] [Bug 11652] New: assertion failures when Type.cpp is compiled with -Os

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 26 15:30:47 PST 2011


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

             Bug #: 11652
           Summary: assertion failures when Type.cpp is compiled with -Os
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nobled at dreamwidth.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This is probably a GCC bug, but does anyone have advice on how to reduce it
further?

GCC version:
g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2

With r147274 and configuring with these options:

cmake ../llvm -DCMAKE_BUILD_TYPE=Debug -DLLVM_BUILD_CLANG=OFF
-DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS=-Os

It causes assertion failures in a ton of unit tests:

.../include/llvm/Type.h:296: llvm::Type* llvm::Type::getContainedType(unsigned
int) const: Assertion `i < NumContainedTys && "Index out of range!"' failed.
Stack dump:
0.    Running pass 'X86 DAG->DAG Instruction Selection' on function '@foo1'

.../lib/Bitcode/Writer/ValueEnumerator.h:94: unsigned int
llvm::ValueEnumerator::getTypeID(llvm::Type*) const: Assertion `I !=
TypeMap.end() && "Type not in ValueEnumerator!"' failed.
Stack dump:
0.    Program arguments: bin/./opt -strip-debug 
1.    Running pass 'Bitcode Writer' on module '<stdin>'.

.../lib/Bitcode/Reader/BitcodeReader.cpp:740: bool
llvm::BitcodeReader::ParseTypeTableBody(): Assertion `TypeList[NumRecords] == 0
&& "Already read type?"' failed.

  Expected Passes    : 4167
  Expected Failures  : 50
  Unsupported Tests  : 13
  Unexpected Failures: 1437


Taking off that -DCMAKE_CXX_FLAGS=-Os makes the assertions go away. And copying
Type.cpp.o from a build *without* -Os into a build that was configured *with*
it also fixes them (where -b2 was a good build, and the current directory is a
bad one):
cp -ai ../llvm-b2/lib/VMCore/CMakeFiles/LLVMCore.dir/Type.cpp.o
lib/VMCore/CMakeFiles/LLVMCore.dir/

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