[LLVMbugs] [Bug 21403] New: Assertion "Dangling pointers found in call sites map" with -ffast-math and __builtin_sqrtf

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 28 06:37:14 PDT 2014


            Bug ID: 21403
           Summary: Assertion "Dangling pointers found in call sites map"
                    with -ffast-math and __builtin_sqrtf
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13257
  --> http://llvm.org/bugs/attachment.cgi?id=13257&action=edit
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
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.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141028/c7bf8d6b/attachment.html>

More information about the llvm-bugs mailing list