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 15:16:20 +0000	[thread overview]
Message-ID: <bug-102581-4-cSlh53Yhzs@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 #8 from Jan Hubicka <hubicka at ucw dot cz> ---
Actually, this is shorter patch - we already should notice that one
range is contained in other, but we give up too early.

Honza

diff --git a/gcc/ipa-modref-tree.h b/gcc/ipa-modref-tree.h
index 6a9ed5ce54b..8e9b89b3e2c 100644
--- a/gcc/ipa-modref-tree.h
+++ b/gcc/ipa-modref-tree.h
@@ -110,8 +110,11 @@ struct GTY(()) modref_access_node
               if (!a.parm_offset_known)
                 return false;
               /* Accesses are never below parm_offset, so look
-                 for smaller offset.  */
-              if (!known_le (parm_offset, a.parm_offset))
+                 for smaller offset.
+                 If access ranges are known still allow merging
+                 when bit offsets comparsion passes.  */
+              if (!known_le (parm_offset, a.parm_offset)
+                  && !range_info_useful_p ())
                 return false;
               aoffset_adj = (a.parm_offset - parm_offset)
                             << LOG2_BITS_PER_UNIT;
@@ -618,6 +621,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 15:16 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
2021-10-06 15:16 ` hubicka at ucw dot cz [this message]
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-cSlh53Yhzs@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).