[PATCH] D136080: [flang] Add -ffp-contract option processing

Tom Eccles via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 02:28:10 PDT 2022


tblah marked 8 inline comments as done.
tblah added a comment.

>> The omission of the fast-honor-pragmas argument from the compiler driver is deliberate.
>
> Where is it omitted?

This argument is only supported in the frontend driver, not the compiler driver:

  flang-new -ffp-contract=fast-honor-pragmas test.f90 
  flang-new: error: unsupported argument 'fast-honor-pragmas' to option '-ffp-contract='
  
  flang-new -fc1 -ffp-contract=fast-honor-pragmas test.f90
  warning: ffp-contract= is not currently implemented



================
Comment at: flang/include/flang/Frontend/LangOptions.h:29
+
+    // Enable the floating point pragma
+    FPM_On,
----------------
awarzynski wrote:
> What are these pragmas? Perhaps you can add a test that would include them?
I copied this comment from clang. I believe the pragma is 
```
#pragma clang fp contract(fast)
```

See https://clang.llvm.org/docs/LanguageExtensions.html#extensions-to-specify-floating-point-flags

This patch only adds support for argument processing, so I can't test for the pragmas.


================
Comment at: flang/test/Driver/flang_fp_opts.f90:4
+
+! RUN: %flang_fc1 -ffp-contract=fast %s 2>&1 | FileCheck %s
+! CHECK: ffp-contract= is not currently implemented
----------------
awarzynski wrote:
> Can you test with `flang` as well?
We already test that these flags are passed to the frontend driver from the compiler driver in `flang/test/Driver/frontend-forwarding.f90`


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

https://reviews.llvm.org/D136080



More information about the cfe-commits mailing list