From c4dc3c029416a25103d631e8dc5422f65c076376 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 19 Oct 2022 10:33:12 +0000 Subject: [flang] Add -f[no-]associative-math and -mreassociate Only add the option processing and store the result. No attributes are added to FIR yet. Clang only forwards -mreassociate if (AssociativeMath && !SignedZeros && !TrappingMath) Flang doesn't have -f[no-]trapping-math, so this part of the condition has been omitted. !TrappingMath is the default. Differential Revision: https://reviews.llvm.org/D137329 --- flang/lib/Frontend/CompilerInvocation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index eeadb21..8c0bdcd 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -720,6 +720,12 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc, opts.NoSignedZeros = true; } + if (const llvm::opt::Arg *a = + args.getLastArg(clang::driver::options::OPT_mreassociate)) { + diags.Report(diagUnimplemented) << a->getOption().getName(); + opts.AssociativeMath = true; + } + return true; } -- cgit v1.1