[LLVMbugs] [Bug 22857] New: Assertion failed: (!CS.getInstruction() || !CS.getCalledFunction() || !CS.getCalledFunction()->isIntrinsic())

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 9 10:58:44 PDT 2015


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

            Bug ID: 22857
           Summary: Assertion failed: (!CS.getInstruction() ||
                    !CS.getCalledFunction() ||
                    !CS.getCalledFunction()->isIntrinsic())
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            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 14014
  --> http://llvm.org/bugs/attachment.cgi?id=14014&action=edit
Full log

The following code crashes clang r231653 when compiling with -Ofast:

struct Vector3 {
    float   m[3];
};

static Vector3 operator*(Vector3 lhs, float rhs)
{
    return {{ lhs.m[0] * rhs, lhs.m[1] * rhs, lhs.m[2] * rhs }};
}

static float dot(Vector3 lhs, Vector3 rhs)
{
    return lhs.m[0] * rhs.m[0] + lhs.m[1] * rhs.m[1] + lhs.m[2] * rhs.m[2];
}

static Vector3 projectOnLine(Vector3 vector, Vector3 lineNormal)
{
    return lineNormal * dot(vector, lineNormal);
}

static float intersectsWithCylindryObject(Vector3 obstacleOrientation, Vector3
obstaclePosition)
{
    Vector3 v = projectOnLine(obstaclePosition, obstacleOrientation);
    return __builtin_sqrtf(dot(v, v));
}

float intersect(Vector3 obstaclePosition)
{
    return ::intersectsWithCylindryObject({{ 0.0f, 0.0f, 1.0f }},
obstaclePosition);
}


This results in (full log attached):

% ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++11 -Ofast -c clang.cpp
Assertion failed: (!CS.getInstruction() || !CS.getCalledFunction() ||
!CS.getCalledFunction()->isIntrinsic()), function addCalledFunction, file
/Users/rynnsauer/LLVM/llvm/include/llvm/Analysis/CallGraph.h, line 232.
...

It does not crash when removing the call to __buildin_sqrtf. It also does not
crash when compiling with clang 3.6.0 (tags/RELEASE_360/final).

This looks very similar to bug 21403.

-- 
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/20150309/877a330a/attachment.html>


More information about the llvm-bugs mailing list