<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 - -Wpass-failed not always working"
   href="https://bugs.llvm.org/show_bug.cgi?id=35925">35925</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-Wpass-failed not always working
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>trass3r@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Some unvectorizable code:

void foo(int r[8], int* ptr)
{
    #pragma clang loop vectorize(enable)
    // or: #pragma omp simd
    for (int j = 0; j < 8; ++j)
        if (r[j] < 1000)
            r[j] = *ptr++;
}

$ clang -Werror=pass-failed -O3
compiles just fine because the loop unroller takes precedence.
Only when adding -fno-unroll-loops it produces the warning as expected:
<a href="https://godbolt.org/g/eiEB7G">https://godbolt.org/g/eiEB7G</a>.

This has been noted in 2015 already:
<a href="http://lists.llvm.org/pipermail/cfe-dev/2015-July/044264.html">http://lists.llvm.org/pipermail/cfe-dev/2015-July/044264.html</a>
"We should extend the diagnostics to all passes that could remove a loop"</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>