From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A96833858C2D; Fri, 12 May 2023 18:16:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A96833858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683915415; bh=pAOoyzu6t3olfWBYV5MnKqMAIt5uGW9cQbvftDXK8HM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f9WXMJlJOkD2v1PSqyxvHPj2GcfJ0uuBxJHSyAyN1Z8D9OhfWCrkptBIoyvA1CgDp 0SzKunj0RJ/Z7iRKpb9o/y6DTppoHimtMefpaWEIJfgeEZlPx4o6m0N9WEY8KG9zgd EKOlPW1IxeGVj+TiWUnISH94oJHa4LQ1On1PxH78= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109829] Optimizing __builtin_signbit(x) ? -x : x or abs for FP Date: Fri, 12 May 2023 18:16:55 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: bug_severity cf_reconfirmed_on everconfirmed bug_status 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=3D109829 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Last reconfirmed| |2023-05-12 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski --- >From phiopt1: phiopt match-simplify trying: _1 !=3D 0 ? iftmp.0_5 : x_3(D) Where _1 is defined as: _1 =3D signbitD.1026 (x_3(D)); and iftmp.0_5 is defined as: iftmp.0_5 =3D -x_3(D); This should fix it then: (simplify (cond (ne (SIGNBIT @0) zero_p@1) (neg @0) @0) (abs @0))=