public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] tree-ssa-math-opts: correct -ffp-contract= check
@ 2023-05-17 18:43 Alexander Monakov
  2023-05-18  6:15 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Monakov @ 2023-05-17 18:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alexander Monakov

Since tree-ssa-math-opts may freely contract across statement boundaries
we should enable it only for -ffp-contract=fast instead of disabling it
for -ffp-contract=off.

No functional change, since -ffp-contract=on is not exposed yet.

gcc/ChangeLog:

	* tree-ssa-math-opts.cc (convert_mult_to_fma): Enable only for
	FP_CONTRACT_FAST (no functional change).
---

Preapproved in PR 106092, pushed to trunk.

 gcc/tree-ssa-math-opts.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
index b58a2ac9e6..d71c51dc0e 100644
--- a/gcc/tree-ssa-math-opts.cc
+++ b/gcc/tree-ssa-math-opts.cc
@@ -3320,7 +3320,7 @@ convert_mult_to_fma (gimple *mul_stmt, tree op1, tree op2,
   imm_use_iterator imm_iter;
 
   if (FLOAT_TYPE_P (type)
-      && flag_fp_contract_mode == FP_CONTRACT_OFF)
+      && flag_fp_contract_mode != FP_CONTRACT_FAST)
     return false;
 
   /* We don't want to do bitfield reduction ops.  */
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [committed] tree-ssa-math-opts: correct -ffp-contract= check
  2023-05-17 18:43 [committed] tree-ssa-math-opts: correct -ffp-contract= check Alexander Monakov
@ 2023-05-18  6:15 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-05-18  6:15 UTC (permalink / raw)
  To: Alexander Monakov; +Cc: gcc-patches

On Wed, May 17, 2023 at 8:44 PM Alexander Monakov via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Since tree-ssa-math-opts may freely contract across statement boundaries
> we should enable it only for -ffp-contract=fast instead of disabling it
> for -ffp-contract=off.
>
> No functional change, since -ffp-contract=on is not exposed yet.

OK.

> gcc/ChangeLog:
>
>         * tree-ssa-math-opts.cc (convert_mult_to_fma): Enable only for
>         FP_CONTRACT_FAST (no functional change).
> ---
>
> Preapproved in PR 106092, pushed to trunk.
>
>  gcc/tree-ssa-math-opts.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
> index b58a2ac9e6..d71c51dc0e 100644
> --- a/gcc/tree-ssa-math-opts.cc
> +++ b/gcc/tree-ssa-math-opts.cc
> @@ -3320,7 +3320,7 @@ convert_mult_to_fma (gimple *mul_stmt, tree op1, tree op2,
>    imm_use_iterator imm_iter;
>
>    if (FLOAT_TYPE_P (type)
> -      && flag_fp_contract_mode == FP_CONTRACT_OFF)
> +      && flag_fp_contract_mode != FP_CONTRACT_FAST)
>      return false;
>
>    /* We don't want to do bitfield reduction ops.  */
> --
> 2.39.2
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-18  6:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 18:43 [committed] tree-ssa-math-opts: correct -ffp-contract= check Alexander Monakov
2023-05-18  6:15 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).