From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC3593858436; Wed, 1 Nov 2023 01:32:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC3593858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698802332; bh=vIVkU0L/SQaSpk59ThJqP8MUfprrRffbyq8LvDCH1E0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t2/+dvbc173tlHZFgsRRgqMa9ZLPRHq98V16NrmtGIY0LmwDiRwKqeuWkMR9/vzkR 8/3H1Yr+9A+w+mmeW7Vl9B5W7xf9psQS7j7HHKvJGy25UWCE2bE/NyZZdqcYrFVC66 CnHTT4djIOG2DsTK4bWMzkWgmRaeqTWyF+XySQ04= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112324] phiopt fail to recog if (b < 0) max = MAX(-b, max); else max = MAX (b, max) into max = MAX (ABS(b), max) Date: Wed, 01 Nov 2023 01:32:12 +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 X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc everconfirmed component bug_status bug_severity assigned_to cf_reconfirmed_on 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=3D112324 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu.org Ever confirmed|0 |1 Component|middle-end |tree-optimization Status|UNCONFIRMED |ASSIGNED Severity|normal |enhancement Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org Last reconfirmed| |2023-11-01 --- Comment #1 from Andrew Pinski --- Mine. There is another bug which is very much similar to this but: max_19 =3D MAX_EXPR <_4, max_6>; goto ; [INV] : _8 =3D MAX_EXPR ; : # max_5 =3D PHI Basically we need to pull MAX_EXPR out of the if and then the ABS will be recognized and all.=