[PATCH] D71635: [clang] Rename -frounding-math to -fexperimental-rounding-math and add -frounding-math back as a gcc-compat arg.

Andy Kaylor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 18 17:40:38 PST 2019


andrew.w.kaylor added a comment.

In D71635#1790611 <https://reviews.llvm.org/D71635#1790611>, @MaskRay wrote:

> Before:
>
>   % clang -frounding-math -fsyntax-only -x c /dev/null
>   clang-10: warning: Support for floating point control option frounding-math is incomplete and experimental [-Wexperimental-float-control]
>
>
> CC1 will do rounding math things.
>
> After
>
>   % clang -frounding-math -fsyntax-only -x c /dev/null
>   clang-10: warning: optimization flag '-frounding-math' is not supported [-Wignored-optimization-argument]
>
>
> CC1 will not do rounding math things. -fexperimental-rounding-math if the user really wants to use the feature.
>
> Is my understanding correct? If yes, this patch seems pretty reasonable to me, because -frounding-math is currently incomplete/unsafe.
>
> You may consider not changing CC1 options as they are not user facing.


My understanding is this:

Before D62731 <https://reviews.llvm.org/D62731>:

  % clang -frounding-math -fsyntax-only -x c /dev/null
  clang-10: warning: optimization flag '-frounding-math' is not supported [-Wignored-optimization-argument]

After D62731 <https://reviews.llvm.org/D62731>:

  % clang -frounding-math -fsyntax-only -x c /dev/null
  clang-10: warning: Support for floating point control option frounding-math is incomplete and experimental [-Wexperimental-float-control]

After D71671 <https://reviews.llvm.org/D71671>:

  % clang -frounding-math -fsyntax-only -x c /dev/null
  <no warning>

I suppose this patch would be updated to put us back where we were before D62731 <https://reviews.llvm.org/D62731> in terms of the warning and require an additional option for anyone who wants to use the rounding math implementation as it is currently implemented.

The support for -frounding-math is incomplete, but I'm not sure it's unsafe. It's no more unsafe than not using the flag at all. The same reasoning applies to -ftrapping-math which was accepted without warning well before D62731 <https://reviews.llvm.org/D62731> and has never been completely implemented.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71635





More information about the cfe-commits mailing list