<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Assertion failure: PredBB->getSingleSuccessor() == ParentBB in SpeculateAroundPHIs.cpp"
   href="https://bugs.llvm.org/show_bug.cgi?id=42991">42991</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure: PredBB->getSingleSuccessor() == ParentBB in SpeculateAroundPHIs.cpp
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>zhizhouy@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22375" name="attach_22375" title="reproduce">attachment 22375</a> <a href="attachment.cgi?id=22375&action=edit" title="reproduce">[details]</a></span>
reproduce

Find this error while using LLVM with assertion to build linux kernel 4.19 in
ChromeOS, attached is a reproduce, run with:
clang -S -O2 -x c foo-6848da.c

This has been seen since `asm goto` is introduced and kernel 4.19 is using it.

Error:

clang-9: llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp:581: void
speculatePHIs(ArrayRef<llvm::PHINode *>, SmallPtrSetImpl<llvm::Instruction *>
&, SmallSetVector<llvm::BasicBlock *, 16> &, llvm::DominatorTree &): Assertion
`PredBB->getSingleSuccessor() == ParentBB && "We need a non-critical
predecessor to speculate into."' failed.
Stack dump:
0.      Program arguments: /usr/bin/clang-9 -cc1 -triple x86_64-pc-linux-gnu -S
-disable-free -main-file-name foo.ii -mrelocation-model static -mthread-model
posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
/home/zhizhouy/trunk/src/scripts/Workspace/foo.gcno -resource-dir
/usr/lib64/clang/9.0.0 -internal-isystem /usr/local/include -internal-isystem
/usr/lib64/clang/9.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir
/home/zhizhouy/trunk/src/scripts/Workspace -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -faddrsig -o foo.s -x c foo.ii 
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x0000000003ef50f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/bin/clang-9+0x3ef50f8)
 #1 0x0000000003ef2c30 llvm::sys::RunSignalHandlers()
(/usr/bin/clang-9+0x3ef2c30)
 #2 0x0000000003ef57a8 (/usr/bin/clang-9+0x3ef57a8)
 #3 0x00007fc3e6eb7540 __restore_rt (/lib64/libpthread.so.0+0x12540)
 #4 0x00007fc3e5a6fd31 raise (/lib64/libc.so.6+0x35d31)
 #5 0x00007fc3e5a71a41 abort (/lib64/libc.so.6+0x37a41)
 #6 0x00007fc3e5a68437 (/lib64/libc.so.6+0x2e437)
 #7 0x00007fc3e5a684e2 (/lib64/libc.so.6+0x2e4e2)
 #8 0x0000000004e65361 (/usr/bin/clang-9+0x4e65361)
 #9 0x0000000004e5fecb llvm::SpeculateAroundPHIsPass::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&) (/usr/bin/clang-9+0x4e5fecb)
#10 0x0000000004e3910d (/usr/bin/clang-9+0x4e3910d)
#11 0x0000000003888d22 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&) (/usr/bin/clang-9+0x3888d22)
#12 0x0000000004e2e92c (/usr/bin/clang-9+0x4e2e92c)
#13 0x00000000038875e2 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (/usr/bin/clang-9+0x38875e2)
#14 0x0000000004e3a62d (/usr/bin/clang-9+0x4e3a62d)
#15 0x00000000038875e2 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (/usr/bin/clang-9+0x38875e2)
#16 0x00000000044b238a (/usr/bin/clang-9+0x44b238a)
#17 0x00000000044aaa4a clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >)
(/usr/bin/clang-9+0x44aaa4a)
#18 0x00000000047e94d6 (/usr/bin/clang-9+0x47e94d6)
#19 0x000000000580b246 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/clang-9+0x580b246)
#20 0x000000000471f533 clang::FrontendAction::Execute()
(/usr/bin/clang-9+0x471f533)
#21 0x0000000004693294
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/clang-9+0x4693294)
#22 0x00000000047e3b37
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/clang-9+0x47e3b37)
#23 0x0000000002a4b1ff cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-9+0x2a4b1ff)
#24 0x0000000002a48191 main (/usr/bin/clang-9+0x2a48191)
#25 0x00007fc3e5a5ba8e __libc_start_main (/lib64/libc.so.6+0x21a8e)
#26 0x0000000002a4502a _start (/usr/bin/clang-9+0x2a4502a)
clang-9: error: unable to execute command: Aborted
clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)</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>