[PATCH] D98816: PR49585: Emit the jump destination for a for loop 'continue' from within the scope of the condition variable.

Jordan Rupprecht via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 19 11:47:25 PDT 2021


rupprecht added a comment.

The error message I posted earlier was when using O1 <https://reviews.llvm.org/owners/package/1/> + new PM, but it crashes with the old one & no optimizations:

  $ cat /tmp/repro.cc
  void a() {
    for (; int b = 0;) continue;
  }
  $ clang -c /tmp/repro.cc -o /tmp/repro.o
  Referring to a basic block in another function!
    br label %for.inc
  in function _Z1av
  fatal error: error in backend: Broken function found, compilation aborted!
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.      Program arguments: clang -c /tmp/repro.cc -o /tmp/repro.o
  1.      <eof> parser at end of file
  2.      Per-function optimization
  3.      Running pass 'Module Verifier' on function '@_Z1av'
  ...
  $ clang -fno-legacy-pass-manager -O1 -c /tmp/repro.cc -o /tmp/repro.o
  clang: /home/rupprecht/src/llvm-project/llvm/include/llvm/Support/Casting.h:104: static bool llvm::isa_impl_cl<llvm::InvokeInst, const llvm::Instruction *>::doit(const From *) [To = llvm::InvokeInst, From = const llvm::Instruction *]: Assertion `Val && "isa<> used on a null pointer"' failed.
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.      Program arguments: bin/clang -fno-legacy-pass-manager -O1 -c /tmp/repro.cc -o /tmp/repro.o
  1.      <eof> parser at end of file
  2.      Optimizer
  ...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98816/new/

https://reviews.llvm.org/D98816



More information about the cfe-commits mailing list