[LLVMbugs] [Bug 14915] New: ICE on memcpy from short string

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 10 21:12:07 PST 2013


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

             Bug #: 14915
           Summary: ICE on memcpy from short string
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kparzysz at codeaurora.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


--- memcpy-short.c ---
#include <string.h>

void bar(char*);

void foo() {
  char A[100];
  memcpy(A, "lol", 15);
  bar(A);
}
----------------------


clang -c -O2 memcpy-short.c

clang: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1005: llvm::SDValue
llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, llvm::EVT, bool):
Assertion `Elt->getBitWidth() == EltVT.getSizeInBits() && "APInt size does not
match type size!"' failed.
0  clang           0x0000000002129ee2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang           0x000000000212c16a
2  libpthread.so.0 0x00007f5d6ba598f0
3  libc.so.6       0x00007f5d6ae5aa75 gsignal + 53
4  libc.so.6       0x00007f5d6ae5e5c0 abort + 384
5  libc.so.6       0x00007f5d6ae53941 __assert_fail + 241
6  clang           0x000000000198ed0a
llvm::SelectionDAG::getConstant(llvm::ConstantInt const&, llvm::EVT, bool) +
1882
7  clang           0x000000000198ed66
llvm::SelectionDAG::getConstant(llvm::APInt const&, llvm::EVT, bool) + 54
8  clang           0x000000000199706a
9  clang           0x0000000001997675
llvm::SelectionDAG::getMemcpy(llvm::SDValue, llvm::DebugLoc, llvm::SDValue,
llvm::SDValue, llvm::SDValue, unsigned int, bool, bool,
llvm::MachinePointerInfo, llvm::MachinePointerInfo) + 613
10 clang           0x00000000019b773b
llvm::SelectionDAGBuilder::visitIntrinsicCall(llvm::CallInst const&, unsigned
int) + 6171
11 clang           0x00000000019c208e
llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 702
12 clang           0x00000000019a92ea llvm::SelectionDAGBuilder::visit(unsigned
int, llvm::User const&) + 410
13 clang           0x00000000019d1827
llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 55
14 clang           0x00000000019e2d08
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 168
15 clang           0x00000000019e5107
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2151
16 clang           0x00000000019e64c0
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1392
17 clang           0x00000000020c60c8
llvm::FPPassManager::runOnFunction(llvm::Function&) + 568
18 clang           0x00000000020c61ab
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
19 clang           0x00000000020c5b4a
llvm::MPPassManager::runOnModule(llvm::Module&) + 666
20 clang           0x00000000020c5d77 llvm::PassManagerImpl::run(llvm::Module&)
+ 247
21 clang           0x0000000000819ee7
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 1911
22 clang           0x0000000000817619
23 clang           0x0000000000996a3e clang::ParseAST(clang::Sema&, bool, bool)
+ 382
24 clang           0x000000000081602e clang::CodeGenAction::ExecuteAction() +
78
25 clang           0x0000000000692f59 clang::FrontendAction::Execute() + 185
26 clang           0x000000000066f1b5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 341
27 clang           0x0000000000657034
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1716
28 clang           0x000000000064e278 cc1_main(char const**, char const**, char
const*, void*) + 1240
29 clang           0x0000000000655784 main + 7508
30 libc.so.6       0x00007f5d6ae45c4d __libc_start_main + 253
31 clang           0x000000000064d239

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