(original) (raw)
Hi Masoud:
This is because the math.h in your system still has \_\_FINITE\_MATH\_ONLY\_\_ support.
-Ofast in clang will set macro \`\_\_FINITE\_MATH\_ONLY\_\_\` to 1, so it will preprocess your code,
and go into finite math path, which will do the renaming using \_\_asm.
extern double log (double) \_\_asm\_\_ ("" "\_\_log\_finite") \_\_attribute\_\_ ((\_\_nothrow\_\_ ));
This is expected. If you don't want it, you can use -fno-finite-math-only..
Or you can use newer version of glibc (hence no finite path in math.h at all).
Best,
Jinsong Ji (纪金松), PhD.
XL/LLVM on Power Compiler Development
E-mail: jji@us.ibm.comMasoud Ataei via llvm-dev ---07/20/2020 02:09:38 PM---Hi, It seems \_finite math is gone for LLVM right now (
From: Masoud Ataei via llvm-dev
To: llvm-dev
Date: 07/20/2020 02:09 PM
Subject: \[EXTERNAL\] \[llvm-dev\] Weird behavior in LLVM regarding \_finite math
Sent by: "llvm-dev"
Hi,
It seems \_finite math is gone for LLVM right now (https://reviews.llvm.org/D74712) but there are still trace of it here:
$ cat a1.c
#include
double log(double x){
return x;
}
$ cat a2.c
#include
double mylog(double x){
return log(x);
}
Let compile both with -Ofast. We won't see \`\_\_log\_finite\` in the \`a2.s\` but we will see the function name in \`a1.s\` is changed to \`\_\_log\_finite\`. Is it expected?
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
LLVM Developers mailing list
llvm-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev