From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 876583898534; Wed, 22 Jul 2020 07:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 876583898534 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595404780; bh=CiKjFeM9Y1Lodb2OHG/rGcq3C6nXr/+WAVsI/BITECs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EZiHVOcYYrs7vnn7XDCS12JYPxo/l+bfQvnyKSGq4ePSalKspX3weXbtizhIyFUTS xAsW2vnm2wT+X6W8MqGeloHVBtra3ZYx+oNJlU8U2vSRGu4it6Okua6fL65lhZHE/s vPe2QQY3hcbq1A5GSebuZChvvFkGKepStnvIH6iI= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96271] Failure to optimize memcmp of doubles to avoid going through memory Date: Wed, 22 Jul 2020 07:59:40 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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_status component cf_reconfirmed_on everconfirmed 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: Wed, 22 Jul 2020 07:59:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96271 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|target |tree-optimization Last reconfirmed| |2020-07-22 Ever confirmed|0 |1 --- Comment #4 from Richard Biener --- Note this could be folded on the GIMPLE level already similar to how we inline string comparisons of size 1. We should already fold this to MEMCMP_EQ builtins and those can be inlined for bigger sizes, profitable when we can emit a single load to a register for both values (thus power-of-two size up to word_mode at least). Desired gimple: _1 =3D VIEW_CONVERT (a); _2 =3D VIEW_CONVERT (b); _3 =3D _1 !=3D _2; return _3; and memcmp of size 1 can be inlined as two char loads and subtraction.=