[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 15:33:11 PST 2019


rjmccall added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1068
+   Warning<"in functions '#pragma STDC FENV_ACCESS ON' is supported only "
+   "in topmost block, ignoring pragma">,
    InGroup<UnknownPragmas>;
----------------
"'#pragma STDC FENV_ACCESS ON' is only supported in the outermost block in a function, ignoring"

Although, as mentioned, it would be better if we can just support this, if necessary by pessimizing the rest of the function.  You're already marking the definition with an attribute when you see that there's a pragma within it.  Why don't we just (1) add that attribute (once) whenever FENV_ACCESS is on at any point within a function and (2) make sure that we use FP constraints on every FP operation inside a function with the attribute?


================
Comment at: clang/lib/Parse/ParsePragma.cpp:644
+    FPC = LangOptions::FEA_Off;
+  }
+
----------------
This is not ignoring the pragma; this is treating it as if it said `OFF`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69272





More information about the cfe-commits mailing list