public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/102581] [12 Regression] ice in forced_merge, at ipa-modref-tree.h:352 with -fno-strict-aliasing and -O2 since r12-3202-gf5ff3a8ed4ca9173
Date: Wed, 06 Oct 2021 14:56:35 +0000	[thread overview]
Message-ID: <bug-102581-4-r0ZxgsV1FF@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102581-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102581

--- Comment #7 from Jan Hubicka <hubicka at ucw dot cz> ---
Hi,
the problem is that we assume that merge is symmetric (merging a to b
succeeds if and only if merging b to a succeeds). There was one
symetrical path missing in the (fancy and bit ugly) logic on what we can
merge losslessly.

I also added sanity check for this assumption.  So bugs like this should
fire more often.

Honza

diff --git a/gcc/ipa-modref-tree.h b/gcc/ipa-modref-tree.h
index 6a9ed5ce54b..61b4b16dbed 100644
--- a/gcc/ipa-modref-tree.h
+++ b/gcc/ipa-modref-tree.h
@@ -234,6 +234,17 @@ struct GTY(()) modref_access_node
                      record_adjustments);
              return true;
            }
+         if (known_size_p (a.size)
+             && (!known_size_p (size) || known_lt (size, a.size)))
+           {
+             if (((known_size_p (max_size) || known_size_p (a.max_size))
+                  && !known_eq (max_size, a.max_size))
+                  || !known_eq (offset1, aoffset1))
+               return false;
+             update (new_parm_offset, offset1, size, max_size,
+                     record_adjustments);
+             return true;
+           }
          /* If sizes are same, we can extend the interval.  */
          if ((known_size_p (size) || known_size_p (a.size))
              && !known_eq (size, a.size))
@@ -618,6 +629,7 @@ private:
            found = true;
          if (!found && n->merge (*a, false))
            found = restart = true;
+         gcc_checking_assert (found || !a->merge (*n, false));
          if (found)
            {
              accesses->unordered_remove (i);

  parent reply	other threads:[~2021-10-06 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03 21:14 [Bug c++/102581] New: ice in forced_merge, at ipa-modref-tree.h:352 with -fno-strict-aliasing and -O2 dcb314 at hotmail dot com
2021-10-03 21:21 ` [Bug ipa/102581] [12 Regression] " pinskia at gcc dot gnu.org
2021-10-03 21:22 ` pinskia at gcc dot gnu.org
2021-10-03 21:27 ` dcb314 at hotmail dot com
2021-10-04  7:25 ` [Bug ipa/102581] [12 Regression] ice in forced_merge, at ipa-modref-tree.h:352 with -fno-strict-aliasing and -O2 since r12-3202-gf5ff3a8ed4ca9173 marxin at gcc dot gnu.org
2021-10-04  7:28 ` marxin at gcc dot gnu.org
2021-10-04  7:47 ` rguenth at gcc dot gnu.org
2021-10-04  8:16 ` dcb314 at hotmail dot com
2021-10-04  8:19 ` marxin at gcc dot gnu.org
2021-10-04  8:27 ` marxin at gcc dot gnu.org
2021-10-06 14:56 ` hubicka at ucw dot cz [this message]
2021-10-06 15:16 ` hubicka at ucw dot cz
2021-10-07 13:26 ` cvs-commit at gcc dot gnu.org
2021-10-07 13:59 ` hubicka at gcc dot gnu.org
2021-10-07 18:50 ` ian at airs dot com

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=bug-102581-4-r0ZxgsV1FF@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).