From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9F2C739518B5; Thu, 13 Jan 2022 14:06:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F2C739518B5 From: "amacleod at redhat dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2022 14:06:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97909 --- Comment #4 from Andrew Macleod --- 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 informati= on is ever created.=20=20 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 whate= ver ranger knows about global ranges. IF we wish to utilize this via different API points, we can add them.=20=20 Ultimately, we can try to get tighter integration of context with folding.=