<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - InstCombine crashes when invoked with '-debug' on the attached case"
   href="https://llvm.org/bugs/show_bug.cgi?id=24852">24852</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>InstCombine crashes when invoked with '-debug' on the attached case
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>michael.v.zolotukhin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14890" name="attach_14890" title="reproducer">attachment 14890</a> <a href="attachment.cgi?id=14890&action=edit" title="reproducer">[details]</a></span>
reproducer

Stack trace:

$ opt < crash.ll -instcombine -debug
...
INSTCOMBINE ITERATION #1 on main
IC: ADDING: 15 instrs to worklist
IC: Visiting:   %S = alloca [54 x i8], align 16
IC: Visiting:   %D = alloca [128 x i8], align 16
IC: Visiting:   %0 = bitcast [54 x i8]* %S to i8*, !dbg !3
IC: Old =   %0 = bitcast [54 x i8]* %S to i8*, !dbg !3
    New =   <badref> = getelementptr inbounds [54 x i8], [54 x i8]* %S, i32 0,
i32 0
IC: ADD:   <badref> = getelementptr inbounds [54 x i8], [54 x i8]* %S, i32 0,
i32 00  opt                      0x000000010fd2d42d
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 61
1  opt                      0x000000010fd2c9a6 llvm::sys::RunSignalHandlers() +
70
2  opt                      0x000000010fd2de9f SignalHandler(int) + 575
3  libsystem_platform.dylib 0x00007fff93ead52a _sigtramp + 26
4  libsystem_platform.dylib 0x00007fff50f0f828 _sigtramp + 3171296024
5  opt                      0x000000010fb6865e (anonymous
namespace)::AssemblyWriter::printMetadataAttachments(llvm::SmallVectorImpl<std::__1::pair<unsigned
int, llvm::MDNode*> > const&, llvm::StringRef) + 78
6  opt                      0x000000010fb53ea6 (anonymous
namespace)::AssemblyWriter::printInstruction(llvm::Instruction const&) + 15942
7  opt                      0x000000010fb4fcc9
llvm::Value::print(llvm::raw_ostream&, llvm::ModuleSlotTracker&) const + 569
8  opt                      0x000000010fb4f8fe
llvm::Value::print(llvm::raw_ostream&) const + 542
9  opt                      0x000000010f820146
llvm::InstCombineWorklist::Add(llvm::Instruction*) + 182
10 opt                      0x000000010f81d038 llvm::InstCombiner::run() + 2920
11 opt                      0x000000010f81e624
combineInstructionsOverFunction(llvm::Function&, llvm::InstCombineWorklist&,
llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&,
llvm::DominatorTree&, llvm::LoopInfo*) + 3860
12 opt                      0x000000010f81ee4a (anonymous
namespace)::InstructionCombiningPass::runOnFunction(llvm::Function&) + 586
13 opt                      0x000000010fc7a3a8
llvm::FPPassManager::runOnFunction(llvm::Function&) + 328
14 opt                      0x000000010fc7a5fb
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
15 opt                      0x000000010fc7ab46
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 998
16 opt                      0x000000010ecfc314 main + 8468
17 libdyld.dylib            0x00007fff870d65ad start + 1
18 libdyld.dylib            0x0000000000000003 start + 2029165143
Segmentation fault: 11

$ clang -v
clang version 3.8.0 (trunk 247715) (llvm/trunk 247716)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>