On Mon, May 6, 2024 at 11:28 PM Andrew Pinski <quic_apin...@quicinc.com> wrote: > > Like was done for -ffast-math in r0-105946-ga570fc16fa8056, we should > document that -Ofast enables -fmath-errno, -funsafe-math-optimizations, > -finite-math-only, -fno-trapping-math in their documentation. > > Note this changes the stronger "must not" to be "is not" for > -fno-trapping-math > since we do enable it for -Ofast already. > > OK?
OK > gcc/ChangeLog: > > PR middle-end/97263 > * doc/invoke.texi(fmath-errno): Document it is turned on > with -Ofast. > (funsafe-math-optimizations): Likewise. > (ffinite-math-only): Likewise. > (fno-trapping-math): Likewise and use less strong language. > > Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com> > --- > gcc/doc/invoke.texi | 41 ++++++++++++++++++++++------------------- > 1 file changed, 22 insertions(+), 19 deletions(-) > > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 9456ced468a..14ff4d25da7 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -14996,11 +14996,12 @@ with a single instruction, e.g., @code{sqrt}. A > program that relies on > IEEE exceptions for math error handling may want to use this flag > for speed while maintaining IEEE arithmetic compatibility. > > -This option is not turned on by any @option{-O} option since > -it can result in incorrect output for programs that depend on > -an exact implementation of IEEE or ISO rules/specifications for > -math functions. It may, however, yield faster code for programs > -that do not require the guarantees of these specifications. > +This option is not turned on by any @option{-O} option besides > +@option{-Ofast} since it can result in incorrect output for > +programs that depend on an exact implementation of IEEE or > +ISO rules/specifications for math functions. It may, however, > +yield faster code for programs that do not require the guarantees > +of these specifications. > > The default is @option{-fmath-errno}. > > @@ -15017,11 +15018,12 @@ ANSI standards. When used at link time, it may > include libraries > or startup files that change the default FPU control word or other > similar optimizations. > > -This option is not turned on by any @option{-O} option since > -it can result in incorrect output for programs that depend on > -an exact implementation of IEEE or ISO rules/specifications for > -math functions. It may, however, yield faster code for programs > -that do not require the guarantees of these specifications. > +This option is not turned on by any @option{-O} option besides > +@option{-Ofast} since it can result in incorrect output > +for programs that depend on an exact implementation of IEEE > +or ISO rules/specifications for math functions. It may, however, > +yield faster code for programs that do not require the guarantees > +of these specifications. > Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math}, > @option{-fassociative-math} and @option{-freciprocal-math}. > > @@ -15061,11 +15063,12 @@ The default is @option{-fno-reciprocal-math}. > Allow optimizations for floating-point arithmetic that assume > that arguments and results are not NaNs or +-Infs. > > -This option is not turned on by any @option{-O} option since > -it can result in incorrect output for programs that depend on > -an exact implementation of IEEE or ISO rules/specifications for > -math functions. It may, however, yield faster code for programs > -that do not require the guarantees of these specifications. > +This option is not turned on by any @option{-O} option besides > +@option{-Ofast} since it can result in incorrect output > +for programs that depend on an exact implementation of IEEE or > +ISO rules/specifications for math functions. It may, however, > +yield faster code for programs that do not require the guarantees > +of these specifications. > > The default is @option{-fno-finite-math-only}. > > @@ -15089,10 +15092,10 @@ underflow, inexact result and invalid operation. > This option requires > that @option{-fno-signaling-nans} be in effect. Setting this option may > allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example. > > -This option should never be turned on by any @option{-O} option since > -it can result in incorrect output for programs that depend on > -an exact implementation of IEEE or ISO rules/specifications for > -math functions. > +This option is not turned on by any @option{-O} option besides > +@option{-Ofast} since it can result in incorrect output for programs > +that depend on an exact implementation of IEEE or ISO rules/specifications > +for math functions. > > The default is @option{-ftrapping-math}. > > -- > 2.43.0 >