<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-cl: The unwind destination does not have an exception handling instruction!"
   href="https://llvm.org/bugs/show_bug.cgi?id=27056">27056</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl: The unwind destination does not have an exception handling instruction!
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>stephan.bergmann.secondary@googlemail.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=16083" name="attach_16083" title="reproducer">attachment 16083</a> <a href="attachment.cgi?id=16083&action=edit" title="reproducer">[details]</a></span>
reproducer

At least with recent trunk r264249, running

  clang-cl --target=x86_64-pc-windows-mscv -EHsc -Oxs -c PREPROC.cc

on the attached PREPROC.cc fails with

<span class="quote">> The unwind destination does not have an exception handling instruction!
>   %call.i.i.i.i20 = invoke %"struct.STD::vector.1"* @"\01??0?$vector@H@STD@@QEAA@AEBU01@@Z"(%"struct.STD::vector.1"* %scevgep47, %"struct.STD::vector.1"* dereferenceable(8) %scevgep) #3
>           to label %call.i.i.i.i.noexc unwind label %catch.dispatch
> CatchSwitchInst not the first non-PHI instruction in the block.
>   %8 = catchswitch within none [label %catch] unwind to caller
> fatal error: error in backend: Broken function found, compilation aborted!
> clang-3.9: error: clang frontend command failed with exit code 70 (use -v to see invocation)
> clang version 3.9.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a> d2ff6d87678662b1692b85f8d803a98e8343ffc9) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a> 66d1cd513035b7d48d0fb08d71b31884c5f85308)
> Target: x86_64-pc-windows-msvc
> Thread model: posix
> InstalledDir: /home/sbergman/clang/git/inst/bin
> clang-3.9: 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-3.9: note: diagnostic msg: 
> ********************

> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> Preprocessed source(s) and associated run script(s) are located at:
> clang-3.9: note: diagnostic msg: /tmp/PREPROC-ce219e.cpp
> clang-3.9: note: diagnostic msg: /tmp/PREPROC-ce219e.sh
> clang-3.9: note: diagnostic msg: 

> ********************</span >


(The content of /tmp/PREPROC-ce219e.sh being

<span class="quote">> # Crash reproducer for clang version 3.9.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a> d2ff6d87678662b1692b85f8d803a98e8343ffc9) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a> 66d1cd513035b7d48d0fb08d71b31884c5f85308)
> # Driver args: "--driver-mode=cl" "--target=x86_64-pc-windows-mscv" "-EHsc" "-Oxs" "-c" "PREPROC.cc"
> # Original command:  "/home/sbergman/clang/git/inst/bin/clang-3.9" "-cc1" "-triple" "x86_64-pc-windows-msvc18.0.0" "-emit-obj" "-mincremental-linker-compatible" "-disable-free" "-main-file-name" "PREPROC.cc" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-relaxed-aliasing" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-D_MT" "--dependent-lib=libcmt" "--dependent-lib=oldnames" "-fcxx-exceptions" "-fexceptions" "-fexternc-nounwind" "-fms-volatile" "-fdiagnostics-format" "msvc" "-momit-leaf-frame-pointer" "-dwarf-column-info" "-debugger-tuning=gdb" "-coverage-file" 
 "/home/sbergman/TMP/PREPROC.cc" "-resource-dir" "/home/sbergman/clang/git/inst/bin/../lib/clang/3.9.0" "-internal-isystem" "/home/sbergman/clang/git/inst/bin/../lib/clang/3.9.0/include" "-internal-isystem" "C:/Program Files/Microsoft Visual Studio 10.0/VC/include" "-internal-isystem" "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" "-internal-isystem" "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include" "-internal-isystem" "C:/Program Files/Microsoft Visual Studio 8/VC/include" "-internal-isystem" "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" "-Os" "-fdeprecated-macro" "-fdebug-compilation-dir" "/home/sbergman/TMP" "-ferror-limit" "19" "-fmessage-length" "165" "-fms-extensions" "-fms-compatibili
 ty" "-fms-compatibility-version=18" "-std=c++11" "-fno-threadsafe-statics" "-fdelayed-template-parsing" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-o" "PREPROC.obj" "-x" "c++" "PREPROC.cc"
>  "/home/sbergman/clang/git/inst/bin/clang-3.9" "-cc1" "-triple" "x86_64-pc-windows-msvc18.0.0" "-emit-obj" "-mincremental-linker-compatible" "-disable-free" "-main-file-name" "PREPROC.cc" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-relaxed-aliasing" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-D_MT" "--dependent-lib=libcmt" "--dependent-lib=oldnames" "-fcxx-exceptions" "-fexceptions" "-fexternc-nounwind" "-fms-volatile" "-fdiagnostics-format" "msvc" "-momit-leaf-frame-pointer" "-dwarf-column-info" "-debugger-tuning=gdb" "-Os" "-fdeprecated-macro" 
 "-ferror-limit" "19" "-fmessage-length" "165" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=18" "-std=c++11" "-fno-threadsafe-statics" "-fdelayed-template-parsing" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-x" "c++" "PREPROC-ce219e.cpp"</span >

)</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>