<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 - Analyzer crashes (Unexpected CFG element at front of block) with widen-loops=true"
   href="https://bugs.llvm.org/show_bug.cgi?id=37861">37861</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Analyzer crashes (Unexpected CFG element at front of block) with widen-loops=true
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>warren_ristow@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following test-case crashes in the Static Analyzer with an UNREACHABLE:
  Unexpected CFG element at front of block

when widen-loops=true.

$ cat t.cpp
//////////////// "t.cpp" ///////////////
class A {
public:
  void m_fn1();
};
bool g;
void fn1() {
  A a;
  A *b = &a;
  for (;;) {
    g = !b;
    b->m_fn1();
  }
}
////////////////////////////////////////
$ clang --analyze -Xanalyzer -analyzer-config -Xanalyzer widen-loops=true t.cpp
Unexpected CFG element at front of block
UNREACHABLE executed at clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp:740!
Stack dump:
  ...
clang: error: clang frontend command failed due to signal ...
clang version 7.0.0 (trunk 335000)
Target: x86_64-unknown-linux-gnu
  ...
$

As an aside, prior to r319333 it crashed with a different UNREACHABLE, but in
the same area of "StaticAnalyzer/Core/PathDiagnostic.cpp":
  Unexpected ProgramPoint

That "Unexpected ProgramPoint" crash was reported with a different test-case,
as <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - Assertion UNREACHABLE: "Unexpected ProgramPoint" with widen-loops=true"
   href="show_bug.cgi?id=25609">bug 25609</a>.  Just cross-referencing here, since they may be related.</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>