From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADBF83857814; Thu, 7 Mar 2024 13:34:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADBF83857814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709818491; bh=aZeWAEaSN4MZ3FaWKKvu69j/hPjOE4TloDz843kfQZM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eyFNMaawUCyMKrnzVnbN6l7LVaU+s8Sf8VFOhKvQQfbxXMF64smPUArfjg9o+bF7a cRCd4VAxgSufnCLWb6OMRLaVpQq11NJW9OzmF+bH54QsZNlLFAIQGJ8NIT98AwOFFK za0YVZFVWFCDXL04ZEfYpSA2mcHmCzjskvEA3rS4= From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110199] [12/13/14 Regression] Missing VRP transformation with MIN_EXPR and known relation Date: Thu, 07 Mar 2024 13:34:51 +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: 14.0 X-Bugzilla-Keywords: missed-optimization, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: law at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: law at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status everconfirmed cf_reconfirmed_on cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110199 Jeffrey A. Law changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |law at gcc dot gnu.= org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2024-03-07 CC| |law at gcc dot gnu.org --- Comment #6 from Jeffrey A. Law --- I think this is trivial to do in DOM and not handling these cases could eas= ily be seen as an oversight. When we fail to find an expression in the hash table of available expressio= ns, we have a bit of existing code that can ask about a relation between two operands of a binary operator and based on that relation possibly simplify = the original expression. So for example, if we have: _4 =3D MIN_EXPR ; And the MIN_EXPR expression isn't in the hash table, we look to see if we h= ave recorded a_2 =3D=3D b_3 and if so we simplify the MIN_EXPR into a copy. So this is just a matter of extending that code ever so slightly to do an additional lookup.=