public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/103073] [12 Regression] ICE in insert_access, at ipa-modref-tree.h:578 since r12-4401-gfecd145359fc981b
Date: Fri, 05 Nov 2021 12:43:29 +0000	[thread overview]
Message-ID: <bug-103073-4-RBzeoV6dYZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103073-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 5 Nov 2021, hubicka at kam dot mff.cuni.cz wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103073
> 
> --- Comment #8 from hubicka at kam dot mff.cuni.cz ---
> > Well, the usual thing to do is to check max_size_known_p () and
> > if maybe_ne (max_size, size) then use [offset, max_size] for 
> > disambiguation.  I think for modref you can do the same - if max size
> > is known then use [offset, max_size], otherwise you have to punt.  You
> > shouldn't need 'size' at all, 'size' is when you are looking for
> > must-defs.
> 
> While disambiguating ref with decl we also check if size is greater than
> size of decl and in that case we disambiguate.  So tracking sizes helps
> little bit even if not checking for kills.
> 
> I plan to do also kills using modrefs. This helps to propagate clobber
> inter-procedurally. One simply needs one extra flag tracking if store
> must be executed before function returns (I have patch for this).
> 
> Hoever still I am convinced I can simply ignore the range here since
> from VRP we know it will be undefined if ever executed as follows:
> 
> diff --git a/gcc/ipa-modref-tree.h b/gcc/ipa-modref-tree.h
> index 9976e489697..1b51323175b 100644
> --- a/gcc/ipa-modref-tree.h
> +++ b/gcc/ipa-modref-tree.h
> @@ -813,6 +818,20 @@ struct GTY((user)) modref_tree
> 
>      bool changed = false;
> 
> +    /* We may end up with max_size being less than size for accesses past the
> +       end of array.  Those are undefined and safe to ignore.  */
> +    if (a.range_info_useful_p ()
> +       && ((known_size_p (a.size) && known_size_p (a.max_size)
> +            && known_lt (a.max_size, a.size))

What about maybe_lt?  Well, you should know the ICEing place and
whether it's sensitive to may or must ;)

> +           || (known_size_p (a.max_size)
> +               && known_le (a.max_size, 0))))

The known_size_p (a.max_size) && known_le (a.max_size, 0) should never
be true (there's only the -1 special value denoting 'unknown').

> +      {
> +       if (dump_file)
> +         fprintf (dump_file,
> +                  "   - Paradoxical ragne. Ignoring\n");
> +       return false;
> +      }
> +
>      /* No useful information tracked; collapse everything.  */
>      if (!base && !ref && !a.useful_p ())
>        {
> 
> Similarly we could detect this as undefined effect and turn to
> trap/unreachable somewhere if we care.
> 
> This bootstraps/regtests and fixes the testcase.  Does it look sane to
> you?

Yeah, apart from the remark above.

  parent reply	other threads:[~2021-11-05 12:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  1:46 [Bug ipa/103073] New: [12 Regression] ICE in insert_access, at ipa-modref-tree.h:578 vsevolod.livinskij at frtk dot ru
2021-11-04  1:52 ` [Bug ipa/103073] " pinskia at gcc dot gnu.org
2021-11-04  2:01 ` pinskia at gcc dot gnu.org
2021-11-04  7:25 ` [Bug ipa/103073] [12 Regression] ICE in insert_access, at ipa-modref-tree.h:578 since r12-4401-gfecd145359fc981b marxin at gcc dot gnu.org
2021-11-04  9:12 ` rguenth at gcc dot gnu.org
2021-11-04 10:20 ` hubicka at gcc dot gnu.org
2021-11-04 17:04 ` vsevolod.livinskij at frtk dot ru
2021-11-04 18:04 ` hubicka at gcc dot gnu.org
2021-11-04 20:30 ` marxin at gcc dot gnu.org
2021-11-05  7:07 ` rguenther at suse dot de
2021-11-05 12:32 ` hubicka at kam dot mff.cuni.cz
2021-11-05 12:38 ` mliska at suse dot cz
2021-11-05 12:41 ` marxin at gcc dot gnu.org
2021-11-05 12:43 ` rguenther at suse dot de [this message]
2021-11-05 12:44 ` hubicka at kam dot mff.cuni.cz
2021-11-05 12:48 ` hubicka at kam dot mff.cuni.cz
2021-11-05 22:33 ` cvs-commit at gcc dot gnu.org
2021-11-06  7:45 ` hubicka at gcc dot gnu.org

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-103073-4-RBzeoV6dYZ@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).