[PATCH] D88498: [FPEnv] Evaluate initializers in constant rounding mode

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 30 01:01:47 PDT 2020


sepavloff added inline comments.


================
Comment at: clang/test/AST/const-fpfeatures-strict.c:39
+
+// CHECK: @var_04 = {{.*}} %struct.S { float 0x3FF0000020000000 }
+// CHECK: @var_05 = {{.*}} %struct.S { float 0x3FF0000020000000 }
----------------
mibintc wrote:
> I think the initializer for var_04 is evaluated at translation time, therefore the initialization expression would look the same as var_01 above, using default rounding mode.  Same for var_05 and var_06. They have "static duration"
The statement `#pragma STDC FENV_ROUND FE_UPWARD` changes constant rounding mode, so evaluation of the initializer for `var_04` produces different result than in the case of `var_01`, which indeed is evaluated using default rounding mode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88498



More information about the cfe-commits mailing list