From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A13213858D28; Thu, 26 Jan 2023 12:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A13213858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674735672; bh=RoIyCRxUyi5ZxzEBjf7kohqPNdhUSdHSD+Vdb0f7rOo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jAIgV07yufiYh7dH74r1OIs6SMdGSOd+L1BbD6Iq8gM4HzHvcbR0enHdefydjXpsY 9VvT7HbB5iHe+if4MEPBCeXmYxW3sAYCx081Soy30Rpw4mO/lMMnTOFUMcclKCqmdE c3K5NyWeGn9KvRa1SPz7i+W1YF8zKEpYuWWTsl/A= From: "cvs-commit 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: Thu, 26 Jan 2023 12:21:11 +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: cvs-commit 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 #4 from CVS Commits --- The master branch has been updated by Siddhesh Poyarekar : https://gcc.gnu.org/g:0573a0778af88e805f7630ac8640ecd67d692665 commit r13-5382-g0573a0778af88e805f7630ac8640ecd67d692665 Author: Siddhesh Poyarekar Date: Thu Jan 26 07:07:03 2023 -0500 tree-optimization/108522 Use component_ref_field_offset Instead of using TREE_OPERAND (expr, 2) directly, use component_ref_field_offset instead, which does scaling for us. The function also substitutes PLACEHOLDER_EXPRs but it is not relevant for tree-object-size. gcc/ChangeLog: PR tree-optimization/108522 * tree-object-size.cc (compute_object_offset): Make EXPR argument non-const. Call component_ref_field_offset. gcc/testsuite/ChangeLog: PR tree-optimization/108522 * gcc.dg/builtin-dynamic-object-size-0.c (DEFSTRUCT): New macro. (test_dynarray_struct_member_b, test_dynarray_struct_member_c, test_dynarray_struct_member_d, test_dynarray_struct_member_subobj_b, test_dynarray_struct_member_subobj_c, test_dynarray_struct_member_subobj_d): New tests. (main): Call them. Signed-off-by: Siddhesh Poyarekar =