From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2BFD3858C78; Wed, 17 May 2023 19:27:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2BFD3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684351637; bh=FZnfXPdXaFHuKbFoha+XVnZDEU1Sfr8csB74LfVuxMM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FFg3DCfNII8jqpkb1qnfdmp9DAxGSReLJboqAlIj3KVweGAa11ngoannoER8TABGt 4NSCss1Cs3m59BBqKiH4PICRD7vaczUaJtZ0Ta79mxE5UGoIDpBsIzlyIvtVEeKqd0 yvFY7fsdRWLaygvabIIDemd84dujZIleyG4k92YA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109868] [13/14 regression] ICE: segmentation fault or ICE in min_value with zero sized bitfield Date: Wed, 17 May 2023 19:27:17 +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: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 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=3D109868 --- Comment #17 from CVS Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:72225ff27217b1a060a24d80cb21bdc1e583ef26 commit r13-7339-g72225ff27217b1a060a24d80cb21bdc1e583ef26 Author: Jakub Jelinek Date: Wed May 17 10:15:50 2023 +0200 c++: Don't try to initialize zero width bitfields in zero initialization [PR109868] My GCC 12 change to avoid removing zero-sized bitfields as they are important for ABI and are needed for layout compatibility traits apparently causes zero sized bitfields to be initialized in the IL, which at least in 13+ results in ICEs in the ranger which is upset about zero precision types. I think we could even avoid initializing other unnamed bitfields, but unfortunately !CONSTRUCTOR_NO_CLEARING doesn't mean in the middle-end clearing of padding bits and until we have some new flag that represents the request to clear padding bits, I think it is better to keep zeroing non-zero sized unnamed bitfields. In addition to skipping those fields, I have changed the logic how UNION_TYPEs are handled, the current code was a little bit weird in that e.g. if first non-static data member had error_mark_node type, we'd hap= pily zero initialize the second non-static data member, etc. 2023-05-17 Jakub Jelinek PR c++/109868 * init.cc (build_zero_init_1): Don't initialize zero-width bitfields. For unions only initialize the first FIELD_DECL. * g++.dg/init/pr109868.C: New test. (cherry picked from commit 78327cf06e6b65fc9c614622c98f6a3f3bfb7784)=