[LLVMbugs] [Bug 12889] New: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be the same"' failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 19 06:08:54 PDT 2012


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

             Bug #: 12889
           Summary: Assertion `BitWidth == RHS.BitWidth && "Bit widths
                    must be the same"' failed
           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: merkil at savhon.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Here is a very reduced testcase that clang as of 157108 fails to compile (at
-O1 and higher).

$ cat file.c
unsigned char c0;

void func(void)
{
    if((c0 = !!c0))
        c0 *= 2;
}

$ ~/clang/build/Release+Asserts/bin/clang -w -O1 14188.c
clang: /home/merkil/clang/llvm/include/llvm/ADT/APInt.h:660: llvm::APInt
llvm::APInt::operator&(const llvm::APInt&) const: Assertion `BitWidth ==
RHS.BitWidth && "Bit widths must be the same"' failed.
0  clang           0x0000000001e5087f
1  clang           0x0000000001e50d69
2  libpthread.so.0 0x00002b074a1a1030
3  libc.so.6       0x00002b074ad85475 gsignal + 53
4  libc.so.6       0x00002b074ad886f0 abort + 384
5  libc.so.6       0x00002b074ad7e621 __assert_fail + 241
6  clang           0x0000000000713f28
7  clang           0x00000000016fcf95
llvm::SelectionDAG::MaskedValueIsZero(llvm::SDValue, llvm::APInt const&,
unsigned int) const + 421
8  clang           0x00000000016bba02
9  clang           0x00000000016de25a
10 clang           0x00000000016df600
11 clang           0x00000000016e0d15
llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AliasAnalysis&,
llvm::CodeGenOpt::Level) + 821
12 clang           0x000000000176c231
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1169
13 clang           0x000000000176f309
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2169
14 clang           0x0000000001770e44
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 772
15 clang           0x0000000001dec73f
llvm::FPPassManager::runOnFunction(llvm::Function&) + 607
16 clang           0x0000000001dec793
llvm::FPPassManager::runOnModule(llvm::Module&) + 51
17 clang           0x0000000001dec30c
llvm::MPPassManager::runOnModule(llvm::Module&) + 524
18 clang           0x0000000001dec417 llvm::PassManagerImpl::run(llvm::Module&)
+ 151
19 clang           0x00000000008b7368
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 2088
20 clang           0x00000000008b543f
21 clang           0x00000000009e7e4d clang::ParseAST(clang::Sema&, bool, bool)
+ 461
22 clang           0x00000000008b41d4 clang::CodeGenAction::ExecuteAction() +
68
23 clang           0x00000000007696b1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 337
24 clang           0x00000000007506da
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1098
25 clang           0x0000000000749b10 cc1_main(char const**, char const**, char
const*, void*) + 8992
26 clang           0x00000000007393b9 main + 7689
27 libc.so.6       0x00002b074ad71ead __libc_start_main + 253
28 clang           0x0000000000746c49
Stack dump:
0.    Program arguments: /home/merkil/clang/build/Release+Asserts/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
file.c -mrelocation-model static -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22 -momit-leaf-frame-pointer -resource-dir
/home/merkil/clang/build/Release+Asserts/bin/../lib/clang/3.2
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/local/include -internal-isystem
/home/merkil/clang/build/Release+Asserts/bin/../lib/clang/3.2/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-w -fdebug-compilation-dir /home/merkil/misc/creduce/c_reduce -ferror-limit 19
-fmessage-length 169 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/file-7pumMa.o -x c file.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'file.c'.
4.    Running pass 'X86 DAG->DAG Instruction Selection' on function '@func'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/file-pH7AV3.i
clang: note: diagnostic msg: /tmp/file-pH7AV3.sh

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