[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 11:21:37 PDT 2024


spavloff wrote:

> Hmm. Is there some sort of optimization in IRGen that we need to suppress here, or is it something in LLVM code gen? Presumably normal LLVM optimization passes all just skip `optnone` functions.

The issue https://github.com/llvm/llvm-project/issues/62098 demonstrates such case. Anyway, It is not good to have bogus attributes in AST.

> Mostly I'm wondering how far we're expected to go with `optnone`.

It impedes implementation of pragma FENV_ROUND. The pragma requires setting FP options inside CompoundStmt and it interacts with the fictious attributes. This is the reason of this patch.



https://github.com/llvm/llvm-project/pull/85605


More information about the cfe-commits mailing list