From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D9C03858D20; Sun, 31 Dec 2023 06:37:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D9C03858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704004648; bh=6mzac72NSUrJmyuXq/uWUGQn4GN+8uNlBRoiylPx+po=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nyHRr1cQ4YKe86u3NMkYcapYMBAdb/zU2yJQC4XcUNzaB2xwZWb6Q3N9ksdy5i4sm QFpte91NbP0W/wTIZxb50kDIIaBdaCatPPG21sHbOQw+8EYM2XBU6B22d6ahgPKsp9 67jJCrzdVvydfsYbr9IydDenK5xqWvdfoKMwW6cE= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113180] MIPS: bitops on an long long struct uses ins instead dins (or with -mstrict-align on aarch64) Date: Sun, 31 Dec 2023 06:37:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown 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: cf_gcctarget 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=3D113180 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Target|mips aarch64*-*-* |mips aarch64*-*-* arm*-* --- Comment #2 from Andrew Pinski --- arm is just as bad: ``` xx: @ args =3D 8, pretend =3D 0, frame =3D 8 @ frame_needed =3D 0, uses_anonymous_args =3D 0 @ link register save eliminated. sub sp, sp, #8 mov r3, r0 strd r1, r2, [sp] ldr r1, [sp, #8] ldrb r2, [sp, #7] @ zero_extendqisi2 bfi r2, r1, #4, #4 strb r2, [sp, #7] ldrd r0, r1, [sp] stm r3, {r0, r1} mov r0, r3 add sp, sp, #8 @ sp needed bx lr ``` Basically the variable a is stored to the stack and then modified and then stored to the stack and then loaded and stored to the return location. This is all due to STRICT alignment IIRC.=