From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F006E3858D1E; Tue, 24 Jan 2023 18:28:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F006E3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674584924; bh=BuM/kJPh2MRoUQuw39MPSJY2bMPwS84YRzQ2Zrp+D28=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DoGRvhr6a5+dztk2ttKQgwfVxXREHjHsz7oXGwCsF4LDg+BZi+rJ67RroQ7ZzVhD7 b1bBwKUqa+TBF5q7Ft+8nWLbd8mqMLwmeZXgEf399csbnkTewntHfVHJyU482yvaC6 JZIwJM57/3K5MVcjuZTh5Ocafh6KZHXfBU/OEHFI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108522] [12/13 Regression] ICE in tree-object-size when struct has VLA Date: Tue, 24 Jan 2023 18:28:44 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: siddhesh 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=3D108522 --- Comment #2 from Jakub Jelinek --- Ah, actually off =3D size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), size_int (tree_to_uhwi (DECL_FIELD_BIT_OFFSET (t)) / BITS_PER_UNIT)); So: - off =3D size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), + off =3D size_binop (PLUS_EXPR, TREE_OPERAND (expr, 2) + ? TREE_OPERAND (expr, 2) : DECL_FIELD_OFFSET (t), size_int (tree_to_uhwi (DECL_FIELD_BIT_OFFSET (t)) / BITS_PER_UNIT)); or so.=