<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 fails on Windows with enabled exceptions during loop unrolling"
   href="https://llvm.org/bugs/show_bug.cgi?id=28132">28132</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang fails on Windows with enabled exceptions during loop unrolling
          </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>Windows NT
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adamf88@gmail.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=16544" name="attach_16544" title="Compilation data">attachment 16544</a> <a href="attachment.cgi?id=16544&action=edit" title="Compilation data">[details]</a></span>
Compilation data

If I try to compile this program with exceptions enabled and -O2 then I get
error message:

Assertion failed: L->isLoopSimplifyForm() && "Must put loop into normal form
fir
st.", file
D:\src\llvm_package_272293\llvm\lib\Transforms\Scalar\LoopUnrollPass.
cpp, line 363

compilation script:
clang-cl /EHsc main.cpp -O2 /link

Source code (also in attachment):

#include <vector>

using namespace std;

struct Block
{
    int colorA;
    int colorB;
};

int main()
{
    while (true)
    {
        vector<Block> blocks;
        for (int i = 0; i < 6; i++) {
            blocks.push_back(Block());
        }

        throw Block();
    }
}

In attachment I added also preprocessed source and whole compilation output.

Tested also on most recent available revision @272572</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>