From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 674853858C3A; Thu, 10 Feb 2022 22:34:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 674853858C3A 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: Thu, 10 Feb 2022 22:34:51 +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: Thu, 10 Feb 2022 22:34:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102586 --- Comment #19 from Jakub Jelinek --- With the C7/C8 case, it is actually not just about clearing too much, but clearing different bits: struct C0 {}; struct C1 {}; struct C2 : C1, virtual C0 {}; struct C3 : virtual C2, C1 {}; struct C6 { char c; }; struct C7 : virtual C6, virtual C3, C1 {}; struct C8 : C7 {}; __attribute__((noipa)) void foo (C8 *q) { __builtin_clear_padding (q); } __attribute__((noipa)) void bar (C7 *q) { __builtin_clear_padding (q); } void baz () { C8 c8; foo (&c8); bar (&c8); } will clear in one case the padding byte at offset 8, in the other case will keep that unchanged and will clear the byte after it.=