<html>
    <head>
      <base href="http://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 miscompiles fabs on x86_64-w64-windows-gnu"
   href="http://llvm.org/bugs/show_bug.cgi?id=21470">21470</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang miscompiles fabs on x86_64-w64-windows-gnu
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.5
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>other
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>szabo.antal.92@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13283" name="attach_13283" title="Test case">attachment 13283</a> <a href="attachment.cgi?id=13283&action=edit" title="Test case">[details]</a></span>
Test case

Clang miscompiles fabs on windows x64 using -O1 or greater, if it's parameter
is passed by reference to another function. Instead of the correct value, it
always returns 0. I couldn't reproduce the bug by separately optimizing with
opt, but using "clang -O1 -mllvm -print-before-all -mllvm -print-after-all
bug.cpp" I found that the "Interprocedural Sparse Conditional Constant
Propagation" pass is probably the cause; it replaces the correct return value
in @fabs with an undef ( see <a href="https://gist.github.com/Sh4rK/4ec63273c387f9978799">https://gist.github.com/Sh4rK/4ec63273c387f9978799</a>
). Test case attached.

Clang version:
Downloaded from the MSYS2 project with pacman, package
"mingw64/mingw-w64-x86_64-clang" version 3.5.0-5 ( MSYS2 installation
instructions: <a href="http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/">http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/</a> )

clang -v
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-w64-windows-gnu
Thread model: posix

OS: Windows 8 x64</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>