AntonYudintsev added a comment.

I have found bug in clang-cl (win32 clang), related to recent inroduction of 
ffp-exception-behavior.
Unfortunately, I don't have a working patch yet, and since LLVM bugtracker 
registration is closed, I can not even submit a bug.

So, if it is not a trouble for you, I will email the bug description here.

Please let me know if it isn't appropriate. Bug description:
============================================================

Windows: clang-cl is generating call to non-existing lib function for win32 
with /fp:except option.
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).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62731/new/

https://reviews.llvm.org/D62731



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to