public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amacleod at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/97909] expr_not_equal_to (mainly in match.pd) vs. ranger
Date: Thu, 13 Jan 2022 14:06:56 +0000	[thread overview]
Message-ID: <bug-97909-4-setO1zt4Ze@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97909-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Andrew Macleod <amacleod at redhat dot com> ---
This functionality was added with fc4076752067fb400b43adbd629081df658da246

Commentary here
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583216.html

All one needs is an active ranger via the enable_ranger() API.
*All* queries made from within folding are READ_ONLY.. ie, no new information
is ever created.  

So for accurate results, you need to query the ranges of any operands before
invoking fold to make sure the caches and information are up to date.

Then ::fold_stmt needs to be invoked via ranger->fold_stmt() instead which
provides a hook for the context required.

Any invocation of folding not done thru this interface will revert to whatever
ranger knows about global ranges.

IF we wish to utilize this via different API points, we can add them.  

Ultimately, we can try to get tighter integration of context with folding.

  parent reply	other threads:[~2022-01-13 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 16:41 [Bug tree-optimization/97909] New: " jakub at gcc dot gnu.org
2020-11-19 18:07 ` [Bug tree-optimization/97909] " amacleod at redhat dot com
2020-11-20  7:09 ` rguenth at gcc dot gnu.org
2020-11-20 14:35 ` amacleod at redhat dot com
2022-01-13 14:06 ` amacleod at redhat dot com [this message]
2022-01-13 18:52 ` cvs-commit at gcc dot gnu.org
2022-01-13 18:54 ` amacleod at redhat 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-97909-4-setO1zt4Ze@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).