http://llvm.org/bugs/show_bug.cgi?id=21403

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to