<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 - Clang 8.0 SVN (up to 350161) crashed for building Notepad2 (https://github.com/zufuliu/notepad2) for ARM64 in Release configuration"
   href="https://bugs.llvm.org/show_bug.cgi?id=40184">40184</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang 8.0 SVN (up to 350161) crashed for building Notepad2 (https://github.com/zufuliu/notepad2) for ARM64 in Release configuration
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>zufuliu@163.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21280" name="attach_21280" title="Stacktrace for Clang svn 347735 and 350161">attachment 21280</a> <a href="attachment.cgi?id=21280&action=edit" title="Stacktrace for Clang svn 347735 and 350161">[details]</a></span>
Stacktrace for Clang svn 347735 and 350161

Step to Produce:

1. Install latest Visual Studio 2017 15.9.4 and Windows 10 SDK 10.0.17763.0

2. Install LLVM for Visual Studio from
<a href="https://github.com/zufuliu/llvm-utils/releases">https://github.com/zufuliu/llvm-utils/releases</a>, using LLVM_VS2017.zip. This
MSBuild source code is very similar to source in
<a href="http://llvm.org/svn/llvm-project/llvm/trunk/tools/msbuild">http://llvm.org/svn/llvm-project/llvm/trunk/tools/msbuild</a>, except I added ARM64
support (and other small changes):

    <AdditionalOptions Condition="'$(Platform)' ==
'ARM64'">--target=aarch64-pc-windows-msvc $(ClangClAdditionalOptions)
%(AdditionalOptions)</AdditionalOptions>

3. Get source code for <a href="https://github.com/zufuliu/notepad2">https://github.com/zufuliu/notepad2</a>, Open
build\VS2017\Notepad2.sln, select LLVMDebug + ARM64 and LLVMRelease + ARM64 to
build both project, result:

                    LLVMDebug + ARM64           LLVMRelease + ARM64
    metapath        OK                          OK
    Notepad2        OK                          Clang Crashed for both c++17
and c++2a


Host Windows 10 x64 Pro 1803 v10.0.17134.472 on i5-4570.

Detail stacktrace ("/showFilenames -v" is added to LLVM -> Additional Compiler
Options) for c++2a (c++17 is very similar) is in attachment.

SVN r347735 from <a href="http://llvm.org/builds/">http://llvm.org/builds/</a>:

1>Assertion failed:
Subtarget.isCallingConvWin64(MF.getFunction().getCallingConv()) && "Funclets
should only be present on Win64", file
C:\src\llvm_package_347735\llvm\lib\Target\AArch64\AArch64FrameLowering.cpp,
line 1506


Self build 350161 trunk:

1>Assertion failed: unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
"Invalid Object Idx!", file
H:\llvm\llvm\include\llvm/CodeGen/MachineFrameInfo.h, line 489</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>