[LLVMbugs] [Bug 19318] New: Assertion during Peephole Optimization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 2 20:52:14 PDT 2014


            Bug ID: 19318
           Summary: Assertion during Peephole Optimization
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: rtrieu at google.com
                CC: lhames at gmail.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12329
  --> http://llvm.org/bugs/attachment.cgi?id=12329&action=edit
Preprocessed source

include <map>
using std::map;
using std::pair;

template <class T> class Allocator {
  typedef T value_type;
  typedef unsigned size_type;
  typedef T* pointer;
  typedef const T* const_pointer;
  typedef T& reference;
  typedef const T& const_reference;

  template<class X>
  Allocator(X x) { }

  void deallocate(void* memory, size_type size) {
    if ( memory == pointer1 ) {
      pointer2 = pointer1;

  template<class U> struct rebind {
    typedef Allocator<U> other;

  void destroy(void*) {}

  char* pointer1;
  char* pointer2;


class MapWrapper {
  typedef map<int, int, std::less<int>, Allocator<pair<int, int> > > Map;
  Map map_;

MapWrapper::~MapWrapper() {}

clang -g -O2 mapper.cpp

clang-3.5: ../include/llvm/CodeGen/MachineOperand.h:265: unsigned int
llvm::MachineOperand::getReg() const: Assertion `isReg() && "This is not a
register operand!"' failed.
0  clang-3.5       0x0000000001803b2e llvm::sys::PrintStackTrace(_IO_FILE*) +
1  clang-3.5       0x0000000001803e0b
2  clang-3.5       0x000000000180552e
3  libpthread.so.0 0x00007fef83178cb0
4  libc.so.6       0x00007fef823b6425 gsignal + 53
5  libc.so.6       0x00007fef823b9b8b abort + 379
6  libc.so.6       0x00007fef823af0ee
7  libc.so.6       0x00007fef823af192
8  clang-3.5       0x0000000000917cca
9  clang-3.5       0x0000000001f0509c llvm::MachineOperand::setReg(unsigned
int) + 28
10 clang-3.5       0x0000000001f2cb20
llvm::MachineRegisterInfo::markUsesInDebugValueAsUndef(unsigned int) const +
11 clang-3.5       0x0000000001f75c83
12 clang-3.5       0x0000000001f0480e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 110
13 clang-3.5       0x00000000014921bb
llvm::FPPassManager::runOnFunction(llvm::Function&) + 427
14 clang-3.5       0x00000000014924c8
llvm::FPPassManager::runOnModule(llvm::Module&) + 104
15 clang-3.5       0x0000000001492b8a
16 clang-3.5       0x000000000149277e
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 302
17 clang-3.5       0x0000000001493151
llvm::legacy::PassManager::run(llvm::Module&) + 33
18 clang-3.5       0x000000000209bb7c
19 clang-3.5       0x000000000209b4a2
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 114
20 clang-3.5       0x00000000020986d0
21 clang-3.5       0x0000000002b4674c clang::ParseAST(clang::Sema&, bool, bool)
+ 796
22 clang-3.5       0x00000000019f2f09 clang::ASTFrontendAction::ExecuteAction()
+ 345
23 clang-3.5       0x0000000002097b42 clang::CodeGenAction::ExecuteAction() +
24 clang-3.5       0x00000000019f262f clang::FrontendAction::Execute() + 191
25 clang-3.5       0x00000000019bcc4d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 797
26 clang-3.5       0x0000000001b217e4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1044
27 clang-3.5       0x000000000090b5ca cc1_main(char const**, char const**, char
const*, void*) + 698
28 clang-3.5       0x0000000000902d27 main + 759
29 libc.so.6       0x00007fef823a176d __libc_start_main + 237
30 clang-3.5       0x00000000009028d5
Stack dump:
0.    Program arguments: /usr/local/clang/qual/llvm/llvm_build/bin/clang-3.5
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
mapper.cpp -mrelocation-model static -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -g -resource-dir
/usr/local/clang/qual/llvm/llvm_build/bin/../lib/clang/3.5.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem
-internal-isystem /usr/local/include -internal-isystem
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdeprecated-macro -fdebug-compilation-dir
/usr/local/clang/qual/llvm/llvm_build -ferror-limit 19 -fmessage-length 80
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/mapper-8a215e.o -x c++ mapper.cpp 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'mapper.cpp'.
4.    Running pass 'Peephole Optimizations' on function
clang-3.5: error: unable to execute command: Aborted (core dumped)
clang-3.5: error: clang frontend command failed due to signal (use -v to see
clang version 3.5.0 (205487)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.5: note: diagnostic msg: 

Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg: /tmp/mapper-dfa86a.cpp
clang-3.5: note: diagnostic msg: /tmp/mapper-dfa86a.sh
clang-3.5: note: diagnostic msg: 


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140403/64024725/attachment.html>

More information about the llvm-bugs mailing list