[LLVMbugs] [Bug 9028] New: Assertion on valid code when optimization is turned on

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 22 09:24:25 PST 2011


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

           Summary: Assertion on valid code when optimization is turned on
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=6032)
 --> (http://llvm.org/bugs/attachment.cgi?id=6032)
Asserting testcase

The attached file (sorry for the length) produces the following backtrace when
compiled with -O. It compiles fine with no optimization.

clang: SelectionDAG.cpp:916: llvm::SDValue
llvm::SelectionDAG::getConstant(uint64_t, llvm::EVT, bool): Assertion
`(EltVT.getSizeInBits() >= 64 || (uint64_t)((int64_t)Val >>
EltVT.getSizeInBits()) + 1 < 2) && "getConstant with a uint64_t value that
doesn't fit in the type!"' failed.
0  clang           0x0000000002320b41
1  clang           0x0000000002320934
2  libpthread.so.0 0x00007f0c632f68f0
3  libc.so.6       0x00007f0c625e5a75 gsignal + 53
4  libc.so.6       0x00007f0c625e95c0 abort + 384
5  libc.so.6       0x00007f0c625de941 __assert_fail + 241
6  clang           0x0000000001c6d0c5
7  clang           0x0000000001d929e7
8  clang           0x0000000001d9c2dc
9  clang           0x0000000001d91cce
10 clang           0x0000000001d3d83d
11 clang           0x0000000001d42e78 llvm::SelectionDAG::LegalizeTypes() + 74
12 clang           0x0000000001ce9615
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1055
13 clang           0x0000000001ce8d90
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 258
14 clang           0x0000000001ceb292
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2008
15 clang           0x0000000001ce82fd
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 731
16 clang           0x0000000001e4b229
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 95
17 clang           0x000000000224cb2d
llvm::FPPassManager::runOnFunction(llvm::Function&) + 407
18 clang           0x000000000224cd4a
llvm::FPPassManager::runOnModule(llvm::Module&) + 102
19 clang           0x000000000224d07d
llvm::MPPassManager::runOnModule(llvm::Module&) + 459
20 clang           0x000000000224d57b llvm::PassManagerImpl::run(llvm::Module&)
+ 125
21 clang           0x000000000224dad1 llvm::PassManager::run(llvm::Module&) +
39
22 clang           0x00000000010ea194
23 clang           0x00000000010ea265
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 133
24 clang           0x00000000010e5ffe
25 clang           0x000000000123c48b clang::ParseAST(clang::Sema&, bool) + 639
26 clang           0x0000000000fa9a19 clang::ASTFrontendAction::ExecuteAction()
+ 263
27 clang           0x00000000010e6e85 clang::CodeGenAction::ExecuteAction() +
951
28 clang           0x0000000000fa966a clang::FrontendAction::Execute() + 320
29 clang           0x0000000000f922bb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
30 clang           0x0000000000f3f839
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 854
31 clang           0x0000000000f31b09 cc1_main(char const**, char const**, char
const*, void*) + 1032
32 clang           0x0000000000f3adf4 main + 499
33 libc.so.6       0x00007f0c625d0c4d __libc_start_main + 253
34 clang           0x0000000000f31179
Stack dump:
0.      Program arguments: /llvmdebug/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name t.cc
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.20.1 -resource-dir
/llvmdebug/bin/../lib/clang/2.9 -O2 -ferror-limit 19 -fmessage-length 172
-fexceptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o t.o
-x c++ t.cc 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 't.cc'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z1av'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

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