[PATCH] D87528: Enable '#pragma STDC FENV_ACCESS' in frontend cf. D69272 - Work in Progress

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 16:47:07 PDT 2020


mibintc added a comment.

In D87528#2297647 <https://reviews.llvm.org/D87528#2297647>, @sepavloff wrote:

> In D87528#2295015 <https://reviews.llvm.org/D87528#2295015>, @mibintc wrote:
>
>> I tried using the 0924 version of the patch on an internal workload SPEC "cpu2017" and found that a few files failed to compile because of an error message on static initializer, like this: struct s { float f; }; static struct s x = {0.63};   Compiled with ffp-model=strict "initializer..is not a compile-time constant"
>
> Thank you for trying this.
>
> The error happens because static variable initializer gets rounding mode calculated from command-line options (`dynamic`), but this is wrong because such initializers must be calculated using constant rounding mode (`tonearest` in this case). Either we must force default FP mode in such initializers, or we are wrong when using `FPOptions::defaultWithoutTrailingStorage`. Need to analyze this problem more.

@sepavloff Please provide precise reference to support the claim "but this is wrong because such initializers must be calculated using constant rounding mode..."  many thanks!


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

https://reviews.llvm.org/D87528



More information about the cfe-commits mailing list