On Fri, Nov 28, 2025 at 8:17 AM Xi Ruoyao <[email protected]> wrote:
>
> The current wording is misleading because even the combination of
> -frounding-math and -ftrapping-math still doesn't provide the semantics
> required by FENV_ACCESS on.  It can confuse people and prompt them to
> submit more duplicates of PR 34678.  Let's make it clear that we've not
> implemented FENV_ACCESS on yet even with -frounding-math
> -ftrapping-math.

I think this is an improvement over what we have, so OK unless somebody
suggests otherwise over the weekend.

Thanks,
Richard.

> gcc/
>
>         PR middle-end/34678
>         * doc/invoke.texi (-fno-trapping-math): Stop mentioning
>         FENV_ACCESS.
>         (-frounding-math): Likewise.
>         * doc/implement-c.texi: Note that -ftrapping-math
>         -frounding-math is not enough for "FENV_ACCESS on" semantics.
> ---
>
> Superseds https://gcc.gnu.org/pipermail/gcc-patches/2025-November/702123.html.
>
>  gcc/doc/implement-c.texi | 7 ++++---
>  gcc/doc/invoke.texi      | 9 ---------
>  2 files changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/gcc/doc/implement-c.texi b/gcc/doc/implement-c.texi
> index 8f0c2ff4bf3..c2c04445248 100644
> --- a/gcc/doc/implement-c.texi
> +++ b/gcc/doc/implement-c.texi
> @@ -373,9 +373,10 @@ This is subject to change.
>  @cite{The default state for the @code{FENV_ACCESS} pragma (C99 and C11
>  7.6.1, C23 7.6.2).}
>
> -This pragma is not implemented, but the default is to ``off'' unless
> -@option{-frounding-math} is used and @option{-fno-trapping-math} is not
> -in which case it is ``on''.
> +This pragma is not implemented and GCC always behave as if it's set to
> +``off''; even if both @option{-frounding-math} and @option{-ftrapping-math}
> +are effective, GCC still does @emph{not} provide all the semantics required
> +by setting this pragma to ``on''.
>
>  @item
>  @cite{Additional floating-point exceptions, rounding modes, environments,
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index b1e6d703702..10d0ede5384 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -16126,11 +16126,6 @@ for math functions.
>
>  The default is @option{-ftrapping-math}.
>
> -Future versions of GCC may provide finer control of this setting
> -using C99's @code{FENV_ACCESS} pragma.  This command-line option
> -will be used along with @option{-frounding-math} to specify the
> -default state for @code{FENV_ACCESS}.
> -
>  @opindex frounding-math
>  @item -frounding-math
>  Disable transformations and optimizations that assume default floating-point
> @@ -16146,10 +16141,6 @@ The default is @option{-fno-rounding-math}.
>
>  This option is experimental and does not currently guarantee to
>  disable all GCC optimizations that are affected by rounding mode.
> -Future versions of GCC may provide finer control of this setting
> -using C99's @code{FENV_ACCESS} pragma.  This command-line option
> -will be used along with @option{-ftrapping-math} to specify the
> -default state for @code{FENV_ACCESS}.
>
>  @opindex fsignaling-nans
>  @item -fsignaling-nans
> --
> 2.52.0
>

Reply via email to