<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 generates incorrect unwind information on 32-bit mingw"
   href="https://bugs.llvm.org/show_bug.cgi?id=40322">40322</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang generates incorrect unwind information on 32-bit mingw
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>7.0
          </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>marc@groundctl.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21330" name="attach_21330" title="attached program">attachment 21330</a> <a href="attachment.cgi?id=21330&action=edit" title="attached program">[details]</a></span>
attached program

When compiling the attached program with the arguments "-target
i686-w64-mingw32 -O2", the resulting executable aborts.  When compiling with
"-target i686-w64-mingw32 -O0" the executable works correctly.

This appears to be because the generated dwarf unwind information is incorrect.
 When the unwinder looks for the return address of "am" it is off by 4 bytes
and finds the argument to "am", which is 0, and so it thinks the stack has
ended.

I am using the current Arch Linux clang build, version "7.0.1
(tags/RELEASE_701/final)".  This does not happen when targeting
"x86_64-w64-mingw32".  This does not happen when using -O1.</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>