<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 --- - Clang crashes when optimizing code using notail call to a musttail function"
   href="https://llvm.org/bugs/show_bug.cgi?id=31014">31014</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crashes when optimizing code using notail call to a musttail function
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>peter@trailofbits.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=17586" name="attach_17586" title="Test case IR file that, when optimized, reproduces the bug.">attachment 17586</a> <a href="attachment.cgi?id=17586&action=edit" title="Test case IR file that, when optimized, reproduces the bug.">[details]</a></span>
Test case IR file that, when optimized, reproduces the bug.

Command:
clang -c /tmp/bug.ll -o /tmp/bug.bc -O3 -emit-llvm

Backtrace:
pag@sloth:/tmp$ clang -c /tmp/bug.ll -o /tmp/bug.bc -O3 -emit-llvm
warning: overriding the module target triple with x86_64-unknown-linux-gnu
[-Woverride-module]
clang-3.9: /home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:226:
bool {anonymous}::CGPassManager::RefreshCallGraph(llvm::CallGraphSCC&,
llvm::CallGraph&, bool): Assertion `!CheckingMode && "CallGraphSCCPass did not
update the CallGraph correctly!"' failed.
#0 0x00000000028132ea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/pag/git/llvm-3.9.0.src/lib/Support/Unix/Signals.inc:402:0
#1 0x0000000002813689 PrintStackTraceSignalHandler(void*)
/home/pag/git/llvm-3.9.0.src/lib/Support/Unix/Signals.inc:470:0
#2 0x000000000281162d llvm::sys::RunSignalHandlers()
/home/pag/git/llvm-3.9.0.src/lib/Support/Signals.cpp:44:0
#3 0x0000000002812a51 SignalHandler(int)
/home/pag/git/llvm-3.9.0.src/lib/Support/Unix/Signals.inc:256:0
#4 0x00007f25288963e0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
#5 0x00007f2527609428 gsignal
/build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#6 0x00007f252760b02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
#7 0x00007f2527601bd7 __assert_fail_base
/build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
#8 0x00007f2527601c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#9 0x000000000376dd01 (anonymous
namespace)::CGPassManager::RefreshCallGraph(llvm::CallGraphSCC&,
llvm::CallGraph&, bool)
/home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:229:0
#10 0x000000000376d5f9 (anonymous
namespace)::CGPassManager::RunPassOnSCC(llvm::Pass*, llvm::CallGraphSCC&,
llvm::CallGraph&, bool&, bool&)
/home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:137:0
#11 0x000000000376e96f (anonymous
namespace)::CGPassManager::RunAllPassesOnSCC(llvm::CallGraphSCC&,
llvm::CallGraph&, bool&)
/home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:420:0
#12 0x000000000376ecd8 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
/home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:475:0
#13 0x00000000021d0b59 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/pag/git/llvm-3.9.0.src/lib/IR/LegacyPassManager.cpp:1603:0
#14 0x00000000021d12a3 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/pag/git/llvm-3.9.0.src/lib/IR/LegacyPassManager.cpp:1706:0
#15 0x00000000021d14af llvm::legacy::PassManager::run(llvm::Module&)
/home/pag/git/llvm-3.9.0.src/lib/IR/LegacyPassManager.cpp:1738:0
#16 0x0000000002ae012a (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/pag/git/llvm-3.9.0.src/tools/clang/lib/CodeGen/BackendUtil.cpp:733:0
#17 0x0000000002ae02fd clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/pag/git/llvm-3.9.0.src/tools/clang/lib/CodeGen/BackendUtil.cpp:751:0
#18 0x000000000356b15f clang::CodeGenAction::ExecuteAction()
/home/pag/git/llvm-3.9.0.src/tools/clang/lib/CodeGen/CodeGenAction.cpp:848:0
#19 0x00000000030a6656 clang::FrontendAction::Execute()
/home/pag/git/llvm-3.9.0.src/tools/clang/lib/Frontend/FrontendAction.cpp:461:0
#20 0x0000000003045d04
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/pag/git/llvm-3.9.0.src/tools/clang/lib/Frontend/CompilerInstance.cpp:868:0
#21 0x00000000031f255d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/pag/git/llvm-3.9.0.src/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:241:0
#22 0x00000000016fb953 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/pag/git/llvm-3.9.0.src/tools/clang/tools/driver/cc1_main.cpp:116:0
#23 0x00000000016ee392 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/home/pag/git/llvm-3.9.0.src/tools/clang/tools/driver/driver.cpp:301:0
#24 0x00000000016eeea8 main
/home/pag/git/llvm-3.9.0.src/tools/clang/tools/driver/driver.cpp:382:0
#25 0x00007f25275f4830 __libc_start_main
/build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
#26 0x00000000016ebac9 _start (/usr/local/bin/clang-3.9+0x16ebac9)
Stack dump:
0.    Program arguments: /usr/local/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free
-main-file-name bug.ll -mrelocation-model static -mthread-model posix
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-dwarf-column-info -debugger-tuning=gdb -coverage-file /tmp/bug.bc
-resource-dir /usr/local/bin/../lib/clang/3.9.0 -O3 -fdebug-compilation-dir
/tmp -ferror-limit 19 -fmessage-length 154 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/bug.bc -x ir /tmp/bug.ll 
1.    Per-module optimization passes
2.    Running pass 'CallGraph Pass Manager' on module '/tmp/bug.ll'.
clang-3.9: error: unable to execute command: Aborted
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.</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>