From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A217D3858416; Mon, 15 Nov 2021 09:19:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A217D3858416 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55177] missed optimizations with __builtin_bswap Date: Mon, 15 Nov 2021 09:19:52 +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: 4.7.2 X-Bugzilla-Keywords: missed-optimization, TREE 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: see_also 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: Mon, 15 Nov 2021 09:19:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55177 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D94718 --- Comment #23 from Andrew Pinski --- (In reply to Andrew Pinski from comment #20) > diff --git a/gcc/match.pd b/gcc/match.pd > index 363006e28fd..d0258a19534 100644 > --- a/gcc/match.pd > +++ b/gcc/match.pd > @@ -1393,7 +1393,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > /* Or if the precision of TO is not the same as the precision > of its mode. */ > || !type_has_mode_precision_p (type))) > - (convert (bitop @0 (convert @1)))))) > + (convert (bitop @0 (convert @1))))) > + (simplify > + (convert (bitop:c (nop_convert @0) @1)) > + (if (tree_nop_conversion_p (type, TREE_TYPE (@1)) > + && types_match (type, TREE_TYPE (@0))) > + (bitop @0 (convert @1))))) >=20 > (for bitop (bit_and bit_ior) > rbitop (bit_ior bit_and) Note this part of the patch went in as part of PR 94718.=