From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA5F73858C31; Thu, 23 Mar 2023 13:54:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA5F73858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679579660; bh=0VkUypNBjsVCaShFVxjrpM1R6SEGJ/dhXFzX43otBlo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rCK5RQ8TlASNKyh3zJHGIBdVXOgbgZxmvHAZ9WTpN1tnZnn5Lwh7BdplHmF26jJcz 6dKAFXXqd1nJq4g40hjzV8qoEz4mnolxy5w3NiF0oPxoecoMNEo8v6kHMFuns/kaht i/Q13vKFZ12ww9Vep5W9qKtil0jrEuU5RlOn+UQw= From: "bergner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/41742] Unnecessary zero-extension at -O2 but not -O1 Date: Thu, 23 Mar 2023 13:54:19 +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: 4.5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: bergner 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: cc 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=3D41742 Peter Bergner changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bergner at gcc dot gnu.org --- Comment #3 from Peter Bergner --- Update: current code (both powerpc64-linux and powerpc64le-linux) still con= tain the unneeded rlwinm, but now we've replaced the loop with a call to libc's memset and we do not shrink-wrap the call due to the use of the non-volatile r31 in the entry block.=20 foo: cmpdi 0,5,0 std 31,-8(1) stdu 1,-128(1) mr 31,3 beq 0,.L4 mflr 0 rlwinm 4,4,0,0xff std 0,144(1) bl memset nop ld 0,144(1) mtlr 0 .L4: addi 1,1,128 mr 3,31 ld 31,-8(1) blr=