<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 --- - crash in llvm::ReplaceableMetadataImpl::get during 'Combine redundant instructions'"
   href="https://llvm.org/bugs/show_bug.cgi?id=26219">26219</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash in llvm::ReplaceableMetadataImpl::get during 'Combine redundant instructions'
          </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>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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rogero@howzatt.demon.co.uk
          </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=15672" name="attach_15672" title="Original source code">attachment 15672</a> <a href="attachment.cgi?id=15672&action=edit" title="Original source code">[details]</a></span>
Original source code

The following short program crashes with clang++ with -O2 or -O3:

#include <map>
#include <vector>

int main()
{
    std::map<int, int> m;

    const std::vector<char> vec { 0 };
    for (auto it = vec.begin(); it != vec.end(); ++it)
    {}
}

I'm using a clang built from a recent (Jan 11th) git snapshot.

clang++ -std=c++11 -O2 -Weverything combine-redundant-instructions-crash.cxx -c
-save-temps

  uname -a: Linux linuxdev121 2.6.32-573.3.1.el6.x86_64 #1 SMP Thu Aug 13
12:55:33 CDT 2015 x86_64 x86_64 x86_64 GNU/Linux</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>