[PATCH] D31806: [SimplifyLibCalls] Fix infinite loop with fast-math optimization.

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 11:07:17 PDT 2017


andrewng added a comment.

In https://reviews.llvm.org/D31806#721631, @efriedma wrote:

> Can you explain a little more how exactly we end up in this situation?  Your example has undefined behavior according to the C standard.


The issue crops up on Mingw-w64 for x86_64 target, as their "math.h" header contains an inline definition of "expf" similar to my example. When compiling with "-O2 -ffast-math", functions calling "expf" are optimized to infinite loops. Is this the information you're looking for? Thanks.


https://reviews.llvm.org/D31806





More information about the llvm-commits mailing list