public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5434] Fix ignore_nondeterminism_p in ipa-modref
Date: Sat, 20 Nov 2021 23:40:01 +0000 (GMT)	[thread overview]
Message-ID: <20211120234001.8C0493857815@sourceware.org> (raw)

https://gcc.gnu.org/g:ce2dbf943ac8ffefe048016ac3abfd3b6a4518d4

commit r12-5434-gce2dbf943ac8ffefe048016ac3abfd3b6a4518d4
Author: Jan Hubicka <jh@suse.cz>
Date:   Sun Nov 21 00:39:42 2021 +0100

    Fix ignore_nondeterminism_p in ipa-modref
    
    Improve debug output in ipa-modref and fix ignore_nondeterminism predicate:
    looping pures and cont are still deterministic.
    
    gcc/ChangeLog:
    
    2021-11-21  Jan Hubicka  <hubicka@ucw.cz>
    
            PR ipa/103052
            * ipa-modref.c (ignore_nondeterminism_p): Allow looping pure/cont.
            (merge_call_side_effects): Improve debug output.

Diff:
---
 gcc/ipa-modref.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index 57e2aa5d868..20810c74da5 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -923,8 +923,7 @@ record_access_p (tree expr)
 static bool
 ignore_nondeterminism_p (tree caller, int flags)
 {
-  if ((flags & (ECF_CONST | ECF_PURE))
-      && !(flags & ECF_LOOPING_CONST_OR_PURE))
+  if (flags & (ECF_CONST | ECF_PURE))
     return true;
   if ((flags & (ECF_NORETURN | ECF_NOTHROW)) == (ECF_NORETURN | ECF_NOTHROW)
       || (!opt_for_fn (caller, flag_exceptions) && (flags & ECF_NORETURN)))
@@ -1016,6 +1015,10 @@ merge_call_side_effects (modref_summary *cur_summary,
       && !(flags & ECF_LOOPING_CONST_OR_PURE))
     return changed;
 
+  if (dump_file)
+    fprintf (dump_file, " - Merging side effects of %s\n",
+	     callee_node->dump_name ());
+
   if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
       || (flags & ECF_LOOPING_CONST_OR_PURE))
     {
@@ -1061,8 +1064,7 @@ merge_call_side_effects (modref_summary *cur_summary,
     }
 
   if (dump_file)
-    fprintf (dump_file, " - Merging side effects of %s with parm map:",
-	     callee_node->dump_name ());
+    fprintf (dump_file, "   Parm map:");
 
   parm_map.safe_grow_cleared (gimple_call_num_args (stmt), true);
   for (unsigned i = 0; i < gimple_call_num_args (stmt); i++)


                 reply	other threads:[~2021-11-20 23:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211120234001.8C0493857815@sourceware.org \
    --to=hubicka@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).