From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9BF273858C52; Thu, 19 Jan 2023 23:20:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BF273858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674170431; bh=pWzvIWbiBZmzbf4x0Udj8/5/fCbcEKhm9SRQ1xsZg7U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NVgK1d7Trq/90BkY8Mi7Pf9wy/yCZRDBjdoStin49yt7WIWo2gOzPhEpoeVonwxQw Du/MeaSJJiKa4niz/lVJgL4ouGcmGxbqJXnWWaEMyR7q14+kpLdBwT/MxJYeqMeWAX pXAzfY9ftjPn0YnkjKVNWdSetJi7naPImDIHCGI0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94804] Failure to elide useless movs in 128-bit addition with __int128_t arguments Date: Thu, 19 Jan 2023 23:20:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal 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: blocked short_desc 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=3D94804 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |101926 Summary|Failure to elide useless |Failure to elide useless |movs in 128-bit addition |movs in 128-bit addition | |with __int128_t arguments --- Comment #6 from Andrew Pinski --- This is ra issue with arguments really. We get good code with: ``` using i128 =3D __int128; i128 sub128(i128 *a, i128 *b) { return *a - *b; } ``` ``` movq (%rdi), %rax movq 8(%rdi), %rdx subq (%rsi), %rax sbbq 8(%rsi), %rdx ``` With: ``` using i128 =3D __int128; void sub128(i128 a, i128 b, i128 *c) { *c =3D a - b; } ``` We get not so good code (extra movs): ``` movq %rsi, %rax movq %rdi, %rsi movq %rax, %rdi subq %rdx, %rsi sbbq %rcx, %rdi movq %rsi, (%r8) movq %rdi, 8(%r8) ``` Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101926 [Bug 101926] [meta-bug] struct/complex argument passing and return should be improved=