<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 --- - mingw32:clang++ compile crash when use -O2 : around allocate heap memory?"
   href="https://llvm.org/bugs/show_bug.cgi?id=28493">28493</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>mingw32:clang++ compile crash when use -O2 : around allocate heap memory?
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.8
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>yume-wikijp@live.jp
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm using msys2 mingw32 clang++.

$ clang++ sample.cpp -v -o sample.out -O2 -Wall -Wextra -std=c++11
clang version 3.8.0 (tags/RELEASE_380/final)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: D:\msys64\mingw32\bin
 "D:\\msys64\\mingw32\\bin\\clang++.exe" -cc1 -triple i686-w64-windows-gnu
-emit-obj -disable-free -disable-llvm-verifier -main-file-name sample.cpp
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -target-cpu pentium4 -momit-leaf-frame-pointer -v
-dwarf-column-info -debugger-tuning=gdb -resource-dir
"D:\\msys64\\mingw32\\bin\\..\\lib\\clang\\3.8.0" -internal-isystem
"D:\\msys64\\mingw32\\i686-w64-mingw32\\include\\c++" -internal-isystem
"D:\\msys64\\mingw32\\i686-w64-mingw32\\include\\c++\\i686-w64-mingw32"
-internal-isystem
"D:\\msys64\\mingw32\\i686-w64-mingw32\\include\\c++\\backward"
-internal-isystem "D:\\msys64\\mingw32\\i686-w64-mingw32\\include\\c++\\5.4.0"
-internal-isystem
"D:\\msys64\\mingw32\\i686-w64-mingw32\\include\\c++\\5.4.0\\i686-w64-mingw32"
-internal-isystem
"D:\\msys64\\mingw32\\i686-w64-mingw32\\include\\c++\\5.4.0\\backward"
-internal-isystem "D:\\msys64\\mingw32\\include\\c++\\5.4.0" -internal-isystem
"D:\\msys64\\mingw32\\include\\c++\\5.4.0\\i686-w64-mingw32" -internal-isystem
"D:\\msys64\\mingw32\\include\\c++\\5.4.0\\backward" -internal-isystem
"D:\\msys64\\mingw32\\lib\\gcc\\i686-w64-mingw32\\5.4.0\\include\\c++"
-internal-isystem
"D:\\msys64\\mingw32\\lib\\gcc\\i686-w64-mingw32\\5.4.0\\include\\c++\\i686-w64-mingw32"
-internal-isystem
"D:\\msys64\\mingw32\\lib\\gcc\\i686-w64-mingw32\\5.4.0\\include\\c++\\backward"
-internal-isystem "D:\\msys64\\mingw32\\bin\\..\\lib\\clang\\3.8.0\\include"
-internal-isystem
"D:\\msys64\\mingw32\\lib\\gcc\\i686-w64-mingw32\\5.4.0\\include"
-internal-isystem
"D:\\msys64\\mingw32\\i686-w64-mingw32/sys-root/mingw/include"
-internal-isystem
"D:\\msys64\\mingw32\\lib\\gcc\\i686-w64-mingw32\\5.4.0\\include-fixed"
-internal-isystem "D:\\msys64\\mingw32\\i686-w64-mingw32\\include"
-internal-isystem "D:\\msys64\\mingw32\\include" -O2 -Wall -Wextra -std=c++11
-fdeprecated-macro -fdebug-compilation-dir
"D:\\user\\documents\\git\\string_split\\sample" -ferror-limit 19
-fmessage-length 203 -fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops
-vectorize-slp -o "D:\\msys64\\tmp\\sample-6463c7.o" -x c++ sample.cpp
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target
i686-w64-windows-gnu
ignoring nonexistent directory "D:\msys64\mingw32\i686-w64-mingw32\include\c++"
ignoring nonexistent directory
"D:\msys64\mingw32\i686-w64-mingw32\include\c++\i686-w64-mingw32"
ignoring nonexistent directory
"D:\msys64\mingw32\i686-w64-mingw32\include\c++\backward"
ignoring nonexistent directory
"D:\msys64\mingw32\i686-w64-mingw32\include\c++\5.4.0"
ignoring nonexistent directory
"D:\msys64\mingw32\i686-w64-mingw32\include\c++\5.4.0\i686-w64-mingw32"
ignoring nonexistent directory
"D:\msys64\mingw32\i686-w64-mingw32\include\c++\5.4.0\backward"
ignoring nonexistent directory
"D:\msys64\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\include\c++"
ignoring nonexistent directory
"D:\msys64\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\include\c++\i686-w64-mingw32"
ignoring nonexistent directory
"D:\msys64\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\include\c++\backward"
ignoring nonexistent directory
"D:\msys64\mingw32\i686-w64-mingw32/sys-root/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 D:\msys64\mingw32\include\c++\5.4.0
 D:\msys64\mingw32\include\c++\5.4.0\i686-w64-mingw32
 D:\msys64\mingw32\include\c++\5.4.0\backward
 D:\msys64\mingw32\bin\..\lib\clang\3.8.0\include
 D:\msys64\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\include
 D:\msys64\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\include-fixed
 D:\msys64\mingw32\i686-w64-mingw32\include
 D:\msys64\mingw32\include
End of search list.
#0 0x05e6779d
#1 0x0028dfd0
#2 0x00e054a1 (D:\msys64\mingw32\bin\clang++.exe+0xa054a1)
#3 0x779fe40c RtlInitUnicodeString (C:\Windows\SysWOW64\ntdll.dll+0x2e40c)
#4 0x779fe172 RtlAllocateHeap (C:\Windows\SysWOW64\ntdll.dll+0x2e172)
#5 0x779fe40c RtlInitUnicodeString (C:\Windows\SysWOW64\ntdll.dll+0x2e40c)
#6 0x779fe172 RtlAllocateHeap (C:\Windows\SysWOW64\ntdll.dll+0x2e172)
#7 0x761d9d45 malloc (C:\Windows\syswow64\msvcrt.dll+0x9d45)
#8 0x6fef6c7a (D:\msys64\mingw32\bin\libstdc++-6.dll+0xb6c7a)
#9 0x021d0c1d (D:\msys64\mingw32\bin\clang++.exe+0x1dd0c1d)
#10 0x6fef6c7a (D:\msys64\mingw32\bin\libstdc++-6.dll+0xb6c7a)
clang++.exe: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (tags/RELEASE_380/final)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: D:\msys64\mingw32\bin
clang++.exe: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang++.exe: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++.exe: note: diagnostic msg: D:\msys64\tmp\sample-704744.cpp
clang++.exe: note: diagnostic msg: D:\msys64\tmp\sample-704744.sh
clang++.exe: note: diagnostic msg:

********************


msys2 mingw32 clang++ only fail. msys2 mingw64 clang++ work fine.


sample.cpp is a part of 
<a href="https://github.com/yumetodo/string_split">https://github.com/yumetodo/string_split</a>
this repo(./sample/sample.cpp).

D:\msys64\tmp\sample-704744.sh
<a href="http://pastebin.com/MFypKbWK">http://pastebin.com/MFypKbWK</a></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>