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: unassignedclangb...@nondot.org
          Reporter: zamazan...@tut.by
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to