[LLVMbugs] [Bug 14533] New: Abort LLVM with gcov options are used when it is built as src->bc->s

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 7 00:56:38 PST 2012


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

             Bug #: 14533
           Summary: Abort LLVM with gcov options are used when it is built
                    as src->bc->s
           Product: libraries
           Version: 3.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: bogon82.kim at samsung.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


LLVM library is aborted at the below code of Constants.cpp 

ConstantArray::ConstantArray(ArrayType *T, ArrayRef<Constant *> V)
  : Constant(T, ConstantArrayVal,
             OperandTraits<ConstantArray>::op_end(this) - V.size(),
             V.size()) {
  assert(V.size() == T->getNumElements() &&
         "Invalid initializer vector for constant array");
   ...
}

This happens when it has been built from bitcode to assembler with
-fprofile-arcs , -coverages or -ftest-coverages and -g which the bitcode files
are also built with gcov options

The reason as I understood is because GCOVProfilerPass has been performed
twice. First one is when it is generated bitcode. Second one is when it is
generated assembler. 

The build scenario is like below.
hello.cpp
int main()
{
    return 1;
}

> clang -O0 -S -emit-llvm -coverage -g hello.cpp -o hello.ll
> clang -O0 -S -coverage -g hello.ll -o hello.s
Assertion failed: V.size() == T->getNumElements() && "Invalid initializer
vector for constant array", file ..\..\..\..\l
lvm_3.1_src\lib\VMCore\Constants.cpp, line 681

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