From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CC573858431; Fri, 11 Feb 2022 16:39:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CC573858431 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102586] [12 Regression] ICE in clear_padding_type, at gimple-fold.c:4798 since r12-3433-ga25e0b5e6ac8a77a Date: Fri, 11 Feb 2022 16:39:36 +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.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2022 16:39:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102586 --- Comment #24 from Jakub Jelinek --- I bet with the default -flifetime-dse=3D2 we would then have a var =3D {}; var =3D{v} {CLOBBER}; // Start of ctor clobber var.whatever =3D ...; // Ctor content and the zero initialization would be optimized away then. I guess ideal would be to emit such zero initialization in the complete obj= ect ctors right after the -flifetime-dse=3D2 beginning clobber and ideally one = that clearly says to the gimplifier and rest of middle-end that it must initiali= ze even padding bits. Because right now gimplification of var =3D {} will often happily lower tha= t to var.a =3D 0; var.b =3D 0; var.c =3D 0; even when there are padding bits, which is ok for most of ctors, but not ok= for D and not ok for C++ zero initialization. So, I think we need some flag on CONSTRUCTORS requesting the initialize also padding bits behavior, set it for D ctors and for C++ zero initialization, properly propagate it through the C++ FE and honor it during gimplification (and wherever else it is needed).=