[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 30 02:57:58 PDT 2022


sepavloff added a comment.

In D126364#3542917 <https://reviews.llvm.org/D126364#3542917>, @efriedma wrote:

> I mean that ActOnPragmaFEnvAccess shouldn't call hasRoundingModeOverride()/setRoundingModeOverride(), and setRoundingMode shouldn't call getAllowFEnvAccess().

setRoundingMode definitely should not call getAllowFEnvAccess() and it does not. As for ActOnPragmaFEnvAccess, it make sense to set the most general mode. Code like:

  {
  #pragma STDC FENV_ACCESS ON
      fesetround(x);
      ...
  }

must work as is, and it requires that operations are created with dynamic rounding mode.

If a user wants to have more specific mode, they can amend FENV_ACCESS with other pragmas, like FENV_ROUND or `clang fp exceptions`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126364



More information about the cfe-commits mailing list