[clang] Ofast deprecation clarifications (PR #101005)
Sjoerd Meijer via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 29 07:54:48 PDT 2024
https://github.com/sjoerdmeijer updated https://github.com/llvm/llvm-project/pull/101005
>From 22f2e40c6d44c562e97162f04dee055a1be57460 Mon Sep 17 00:00:00 2001
From: Sjoerd Meijer <smeijer at nvidia.com>
Date: Mon, 29 Jul 2024 19:31:18 +0530
Subject: [PATCH 1/2] Ofast documentation deprecation clarifications
Following up on the RFC discussion, this is clarifying that the main purpose
and effect of the -Ofast deprecation is to discourage its usage and that
everything else is more or less open for discussion, e.g. there is no timeline
yet for removal.
---
clang/docs/CommandGuide/clang.rst | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst
index 663aca1f6ddcb..c0cd6d61295cb 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -429,8 +429,12 @@ Code Generation Options
:option:`-Ofast` Enables all the optimizations from :option:`-O3` along
with other aggressive optimizations that may violate strict compliance with
- language standards. This is deprecated in favor of :option:`-O3`
- in combination with :option:`-ffast-math`.
+ language standards. This is deprecated in Clang-19 and a warning is emitted
+ that :option:`-O3` in combination with :option:`-ffast-math` should be used
+ instead if the request for non-standard math behavior is intended. There
+ is no timeline yet for removal; the aim is to discourage use of
+ :option:`-Ofast` due to the surprising behavior of an optimization flag
+ changing the observable behavior of correct code.
:option:`-Os` Like :option:`-O2` with extra optimizations to reduce code
size.
>From 6507e9e259cac8d3749f071c8a762a8c1a6d7072 Mon Sep 17 00:00:00 2001
From: Sjoerd Meijer <smeijer at nvidia.com>
Date: Mon, 29 Jul 2024 15:54:39 +0100
Subject: [PATCH 2/2] Update clang/docs/CommandGuide/clang.rst
Co-authored-by: Aaron Ballman <aaron at aaronballman.com>
---
clang/docs/CommandGuide/clang.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst
index c0cd6d61295cb..b026f4bd4737b 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -429,7 +429,7 @@ Code Generation Options
:option:`-Ofast` Enables all the optimizations from :option:`-O3` along
with other aggressive optimizations that may violate strict compliance with
- language standards. This is deprecated in Clang-19 and a warning is emitted
+ language standards. This is deprecated in Clang 19 and a warning is emitted
that :option:`-O3` in combination with :option:`-ffast-math` should be used
instead if the request for non-standard math behavior is intended. There
is no timeline yet for removal; the aim is to discourage use of
More information about the cfe-commits
mailing list