[PATCH] D72675: [Clang][Driver] Fix -ffast-math/-ffp-contract interaction

Warren Ristow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 14:55:04 PST 2020


wristow marked 4 inline comments as done.
wristow added inline comments.


================
Comment at: clang/test/Driver/fast-math.c:196
+// RUN: %clang -### -ffast-math -ffp-contract=fast -c %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s
+//
----------------
wristow wrote:
> andrew.w.kaylor wrote:
> > What about "-ffp-contract=off -ffast-math"? The way the code is written that will override the -ffp-contract option. That's probably what we want, though it might be nice to have a warning.
> Yes, currently `-fffast-math` will override that earlier `-ffp-contract=off` settings.  It's unclear to me whether we're ultimately intending for that to be the behavior (because GCC doesn't do that, as @uweigand noted).  I guess this is another reason to hold off for a bit, until we figure out the wider spec.
Added more tests that illustrate this behavior of "-ffp-contract=off/on -ffast-math" overriding and enabling FMA.  (I haven't added a warning.  Holding off until we decide on other questions discussed in this review.)


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

https://reviews.llvm.org/D72675





More information about the cfe-commits mailing list