[PATCH] D137618: [Clang] Fix behavior of -ffp-model option when overriden
    Zahira Ammarguellat via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Nov  9 07:43:43 PST 2022
    
    
  
zahiraam added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3034
       RoundingFPMath = false;
+      FPExceptionBehavior = "";
       // If fast-math is set then set the fp-contract mode to fast.
----------------
 FPExceptionBehavior should be set here and in case options::OPT_ffp_model_EQ:
================
Comment at: clang/test/Driver/fp-model.c:69
 
+// RUN: %clang -### -ffp-model=fast -ffp-model=strict -c %s 2>&1 | FileCheck \
+// RUN:   --check-prefix=WARN11 %s
----------------
Add a RUN command for '-ffast-math -ffp-model=strict'. I would expect the same warning.
Currently (without your patch) it is generating this non-sense warning:
https://godbolt.org/z/eW679Y7G3
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137618/new/
https://reviews.llvm.org/D137618
    
    
More information about the cfe-commits
mailing list