[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 17 09:15:37 PST 2020


sepavloff added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:13129
     if (FunctionDecl *F = dyn_cast<FunctionDecl>(CurContext)) {
+      // If the expression occurs inside an internal global_var_init_function
+      // then the FunctionDecl is not availble
----------------
mibintc wrote:
> sepavloff wrote:
> > The standard says that static initializers execute in default FP mode.
> > The standard says ...
> Are you sure about this one?  Can you please provide the standards reference so I can study it?
>> The standard says ...
> Are you sure about this one? Can you please provide the standards reference so I can study it?

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf, F.8.5:
```
... All computation for initialization of objects that have static or thread storage duration is done (as if) at translation time.
```
F.8.2:
```
During translation the IEC 60559 default modes are in effect:
— The rounding direction mode is rounding to nearest.
— The rounding precision mode (if supported) is set so that results are not shortened.
— Trapping or stopping (if supported) is disabled on all floating-point exceptions.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72841





More information about the cfe-commits mailing list