<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 - std::exp() produces infinite loop on Windows with -Ofast"
   href="https://bugs.llvm.org/show_bug.cgi?id=32398">32398</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::exp() produces infinite loop on Windows with -Ofast
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows XP
          </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>techmeology@techmeology.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18159" name="attach_18159" title="Demonstration of the bug">attachment 18159</a> <a href="attachment.cgi?id=18159&action=edit" title="Demonstration of the bug">[details]</a></span>
Demonstration of the bug

When cross compiling for Windows (I haven't tested native compile on Windows),
std::exp() is miscompiled as an infinite loop if -Ofast is used. exp() works
correctly, and std::exp() works correctly on Linux.

Clang version: 297935 (Also tried a 4.0.0 pre-release with similar results)
OS: Arch Linux

Steps to reproduce: see build.sh in the tarball

Expected result: No infinite loop should be produced.
Actual result: The produced IR has a branch to a branch to itself (i.e: an
infinite loop).

Contents of the tarball:
build.sh
    Shows how I produced all the files in the out directory.
exp.cpp
    A minimal reproducer that demonstrates the bug.
out/windows_ofast/exp_expanded.cpp
    The preprocessed version of exp.cpp on my system for -Ofast on Windows
out/windows_ofast/exp.bc
    The generated IR bitcode for exp.cpp

The remaining files are analogous for -O3 and for native build.</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>