From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AD1813858C62; Tue, 12 Sep 2023 09:25:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD1813858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694510722; bh=AOVRDZAiysD6oWq+w9P3ybnMG7j96TcpncfnwJqMrF0=; h=From:To:Subject:Date:From; b=TKH6ql0ChP3yMxU0wNl+3vhepEu7Aic2XCA3EVcpBxfmK+efB05tMp0pVzhF+6svP 8+jKP4oFpP1G3zsNvQOVRz8ekgAKY5G1R+X7bNaVS+YahRggjIsnUhDmlGbAblOFAF j9jGYS6XDLbExAYMGvEf0G3G/rftBLHm4I3hAoNs= From: "lis8215 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111384] New: missed optimization: GCC adds extra any extend when storing subreg#0 multiple times Date: Tue, 12 Sep 2023 09:25:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lis8215 at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111384 Bug ID: 111384 Summary: missed optimization: GCC adds extra any extend when storing subreg#0 multiple times Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: lis8215 at gmail dot com Target Milestone: --- Simple example: void store_hi_twice(uint32_t src, uint16_t *dst1, uint16_t *dst2) { *dst1 =3D src; *dst2 =3D src; } shows that GCC can't opt out unnecessary zero extend of the src's low half aimed to store two or more times. Many targets are affected, although x86-64 don't.=