From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 951C93857C71; Mon, 23 Nov 2020 16:35:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 951C93857C71 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97950] Unoptimal code generation with __builtin_*_overflow{,_p} for short and __int128 Date: Mon, 23 Nov 2020 16:35:04 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: cc attachments.created 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, 23 Nov 2020 16:35:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97950 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- Created attachment 49613 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49613&action=3Dedit gcc11-pr97950.patch Untested fix for the short cases. As for __int128, I think it would be better if you filed a separate issue, because it has nothing to do with the short one, and mentioned which moves = you find redundant. Generally, some redundant moves will be there with double-= word arithmetics, it is a matter of when exactly it is the right time to lower double-word operations (and which) into word ones, doing it too early preve= nts e.g. STV from doing its job and e.g. doing for __int128 some operations in = SSE registers, while doing it too late may result in the already assigning pair= s of GP registers for the 128-bit pseudos and while some useless moves can be recovered afterwards, certainly not all of them. x86 doesn't really have instructions that would allow implementing the 128-bit multiplications with overflow efficiently.=