<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 3.6.1 fails to build on MSVC 14 in a 32-bit release configuration"
   href="https://llvm.org/bugs/show_bug.cgi?id=24650">24650</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang 3.6.1 fails to build on MSVC 14 in a 32-bit release configuration
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </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>karl.schmidt@autodesk.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>Hi folks,

This is more a Microsoft issue than a problem with clang. I figured I’d report
it here anyhow since I've seen a few reports from other people who are running
into the same issue.

I’m compiling LLVM 3.6.1 using Visual Studio 2015 Professional 14.0.23107.0
D14REL. This works in most configurations after patching in r237863, but I’m
getting a MS compiler crash when compiling ASTContext.cpp for the Win32
platform in the Release configuration. Log:

1>------ Build started: Project: clangAST, Configuration: Release Win32 ------
1>  ASTContext.cpp
1>c:\llvm\llvm-3.6.1.src\tools\clang\lib\ast\astcontext.cpp(334): fatal error
C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246)
1>   To work around this problem, try simplifying or changing the program near
the locations listed above.
1>  Please choose the Technical Support command on the Visual C++
1>   Help menu, or open the Technical Support help file for more information
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I’ve been able to work around this by changing ASTContext.cpp:368 from 

  if (RC) {
    Raw.setRaw(RC);
    Raw.setKind(RawCommentAndCacheFlags::FromDecl);
  } else

to

  if (RC) {
    Raw.setKind(RawCommentAndCacheFlags::FromDecl);
    Raw.setRaw(RC);
  } else

This is of course pure trial-and-error voodoo coding on my part to get around
what I guess is an MSVC optimizer bug, but it seems to work. I haven’t had time
to reduce the problem or reported it to Microsoft.</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>