[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

Bjorn Pettersson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 06:18:46 PDT 2022


bjope added a comment.

Hello. We've got some problem in our downstream tests after this patch and I'm trying to figure out how things are supposed to work. Maybe someone being part of this review knows.

Problem is that we have some libc verification suites that include test cases using `float_t`. But in math.h from for example newlib the type float_t isn't defined if FLT_EVAL_METHOD is set to -1.
The standard says that float_t is implementation defined when FLT_EVAL_METHOD isn't 0/1/2. But I'm not quite sure how that is supposed to be handled (such as where to define float_t if not in math.h).

One question is: If I have a piece of C99 code using float_t, is that code not allowed to be compiled using fast-math?

I guess it should be seen as with fast-math the float_t precision is unknown. But the type still has to be defined somewhere or else the frontend will complain about "unknown type name". But I'm not sure where this is supposed to be handled.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121122



More information about the cfe-commits mailing list