public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Marek Polacek <polacek@redhat.com>,
	Jason Merrill <jason@redhat.com>,
	 gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c-family: implement -ffp-contract=on
Date: Tue, 23 May 2023 14:21:45 +0300 (MSK)	[thread overview]
Message-ID: <0e059864-65ef-2961-04b0-6b0b0ec809e6@ispras.ru> (raw)
In-Reply-To: <CAFiYyc3S32-Fd5GX7oFQTWZG+HpRe5xUV+9zgeygJoJqKd7qjw@mail.gmail.com>


On Tue, 23 May 2023, Richard Biener wrote:
> > Ah, no, I deliberately decided against that, because that way we would go
> > via gimplify_arg, which would emit all side effects in *pre_p. That seems
> > wrong if arguments had side-effects that should go in *post_p.
> 
> Ah, true - that warrants a comment though.

Incrementally fixed up in my tree like this:

diff --git a/gcc/c-family/c-gimplify.cc b/gcc/c-family/c-gimplify.cc
index f7635d3b0c..17b0610a89 100644
--- a/gcc/c-family/c-gimplify.cc
+++ b/gcc/c-family/c-gimplify.cc
@@ -803,6 +803,7 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
                else
                  ops[2] = build1 (NEGATE_EXPR, type, ops[2]);
              }
+           /* Avoid gimplify_arg: it emits all side effects into *PRE_P.  */
            for (auto &&op : ops)
              if (gimplify_expr (&op, pre_p, post_p, is_gimple_val, fb_rvalue)
                  == GS_ERROR)

Alexander

  reply	other threads:[~2023-05-23 11:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 21:03 Alexander Monakov
2023-05-22 10:02 ` Richard Biener
2023-05-22 15:16   ` Alexander Monakov
2023-05-23  6:05     ` Richard Biener
2023-05-23 11:21       ` Alexander Monakov [this message]
2023-06-05 15:33   ` Alexander Monakov
2023-06-19 17:03     ` Alexander Monakov
2023-06-19 18:23       ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e059864-65ef-2961-04b0-6b0b0ec809e6@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=polacek@redhat.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).