public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/114121] wrong code with _BitInt() arithmetics at -O2
Date: Tue, 27 Feb 2024 14:19:02 +0000	[thread overview]
Message-ID: <bug-114121-4-z9gJV5TW6B@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114121-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #10)
> Could we for lookups if range isn't a subset of the found range pretend
> there was not a match, try to see through definitions again and only if it
> yields an equivalent result value range it the same?  Perhaps even remember
> the range used in it and in case we find non-subset lookup having the same
> result union the remembered range?

So pretend we record the first match with using a range that improves
the result in the hashtable.  Then, when looking up the second ref we
hit the hashtable entry, see it has an incompatible range so we can't
use the recorded value.  We can then easily only ignore the entry (the
prototype patch does this).  As we can't easily tell whether we used any
(or even which) range without doing multiple lookups for each ref and
comparing the result "re-doing" things wouldn't work.

But for determining two refs are equivalent it might be enough to avoid
recording any kind of range for when the value was "varying".  The value
of such hashtable entry would be usable even by lookups with narrower
range (but also not yielding any better "constant" value).

I'm trying to improve things this way.

  parent reply	other threads:[~2024-02-27 14:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 18:30 [Bug tree-optimization/114121] New: " zsojka at seznam dot cz
2024-02-26 18:36 ` [Bug tree-optimization/114121] " pinskia at gcc dot gnu.org
2024-02-26 18:42 ` pinskia at gcc dot gnu.org
2024-02-26 18:50 ` jakub at gcc dot gnu.org
2024-02-26 18:58 ` jakub at gcc dot gnu.org
2024-02-26 19:10 ` jakub at gcc dot gnu.org
2024-02-26 19:43 ` jakub at gcc dot gnu.org
2024-02-27  8:26 ` rguenth at gcc dot gnu.org
2024-02-27 10:48 ` rguenth at gcc dot gnu.org
2024-02-27 12:29 ` rguenth at gcc dot gnu.org
2024-02-27 12:40 ` jakub at gcc dot gnu.org
2024-02-27 12:41 ` jakub at gcc dot gnu.org
2024-02-27 13:54 ` rguenth at gcc dot gnu.org
2024-02-27 14:19 ` rguenth at gcc dot gnu.org [this message]
2024-02-27 15:43 ` jakub at gcc dot gnu.org
2024-02-28 14:03 ` cvs-commit at gcc dot gnu.org
2024-02-28 14:04 ` rguenth at gcc dot gnu.org
2024-02-28 23:13 ` pinskia at gcc dot gnu.org
2024-03-12 14:16 ` cvs-commit at gcc dot gnu.org
2024-05-07  6:18 ` cvs-commit 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-114121-4-z9gJV5TW6B@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).