<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 --- - Assertion "Dangling pointers found in call sites map" with -ffast-math and __builtin_sqrtf"
   href="http://llvm.org/bugs/show_bug.cgi?id=21403">21403</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion "Dangling pointers found in call sites map" with -ffast-math and __builtin_sqrtf
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>jonathan.sauer@gmx.de
          </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=13257" name="attach_13257" title="Log of clang run">attachment 13257</a> <a href="attachment.cgi?id=13257&action=edit" title="Log of clang run">[details]</a></span>
Log of clang run

The following code crashes clang r220769 when being compiled with -ffast-math
and -O1:

__attribute__((__always_inline__)) static float sqr(float f)
{
  return f * f;
}

__attribute__((__always_inline__)) static float sqrt(float f)
{
  return __builtin_sqrtf(f);
}

float bar(float f)
{
  return sqrt(sqr(f));
}


This results in (full log attached):

% clang++ -O1 -ffast-math -c clang.cpp

Assertion failed: (CallSites.empty() && "Dangling pointers found in call sites
map"), function RefreshCallGraph, file
/Users/rynnsauer/LLVM/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp, line 343.
0  clang                    0x00000001032b2f0f
llvm::sys::PrintStackTrace(__sFILE*) + 47
1  clang                    0x00000001032b372b SignalHandler(int) + 555
2  libsystem_platform.dylib 0x00007fff9036a5aa _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 1875466864
4  clang                    0x00000001032b34e6 abort + 22
5  clang                    0x00000001032b34c1 __assert_rtn + 81
6  clang                    0x0000000102f15132 (anonymous
namespace)::CGPassManager::RefreshCallGraph(llvm::CallGraphSCC&,
llvm::CallGraph&, bool) + 4034
7  clang                    0x0000000102f13ba5 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&) + 2677
8  clang                    0x000000010323b621
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1137


The code compiles successfully with clang r219601.

Slight changes in the code also make it compile successfully: Removing the call
to "sqr" or "sqrt", or removing the "always inline" attribute all result in a
successful compile.</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>