From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8210D3858436; Tue, 2 May 2023 09:56:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8210D3858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683021362; bh=gnG3CwITRhxFqsV0ZldGc6botYfMgCgnpetGinJOpPg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M/2GNelyKlLfy3Be1C2MBrp+Vqlio2x7deXo8PBjL7l/aBRNf7H4RLMw2pZespANQ SILRhdpl+Y+g/hDw4QB5B3iEoVyaOX5PlGNVwQcHuPR88bWvhkWf9tNcbEm5VytaVA DowlX9u8IjDXCb/GkT1FbA9hH3EHad6zj0ZKDF6U= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109667] [12/13/14 Regression] Unnecessary temporary storage used for 32-byte struct Date: Tue, 02 May 2023 09:56:01 +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: 12.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D109667 --- Comment #3 from Jakub Jelinek --- So, either SRA should be tweaked so that it can deal with DSE trimming of initializations (I think that is the best way forward, after all, user could have done it manually too - struct i256 { long v[4]; }; void assign(struct i256 *v, long z) { struct i256 r; __builtin_memset (&r.v[1], 0, sizeof (long) * 3); for (int i =3D 0; i < 1; ++i)=20 r.v[i] =3D z; *v =3D r; } regressed with r7-2588-gdf7ec09f1209a33b35 ), or we should do something at = the RTL level like it apparently worked before the r7-2588 change, or we should disable trimming in the DSE part before SRA.=