[llvm-bugs] [Bug 44394] New: clang-cl is generating call to non-existing lib function for win32 with /fp:except option

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Dec 28 03:25:52 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=44394

            Bug ID: 44394
           Summary: clang-cl is generating call to non-existing lib
                    function for win32 with /fp:except option
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zamazan4ik at tut.by
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

With recent ffp-exception-behavior=maytrap/strict, fp:except in clang-cl became
generate FPE aware code.

But in case of floorf and ceilf it generates call to non-existing library
function.

clang-cl.exe -m32 /Ox /fp:except testFloor.cpp /FA 
testFloor.cpp:


#include <math.h>
float ret(float v) {  return floorf(v); }


resulting assember:
 push eax
 movss xmm0, dword ptr [esp + 8] 
 movss dword ptr [esp], xmm0
 call _floorf #no such function!!!
 pop eax
 ret


Expected behaviour:

there is no floorf lib function. Like with cosf and other math functions,
floorf in MSVC is implemented as inline function.
So, it should be call to _floor (with apropriate conversion first).

-- 
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/20191228/750ef4a5/attachment.html>


More information about the llvm-bugs mailing list