From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C2A1F385829D; Fri, 7 Oct 2022 17:44:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2A1F385829D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665164695; bh=ZHzrRPY9zqCXiZhwrkH/O3eM4KpygVqNrOC2a5IP/N0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZqPd06DGD6Khvujk/VAWTJSZU76BkfLo6jLeA1kVtuB8ALxZPzxggyvyObkD9o//Y VdLOEr05o2o3YfeneTIVIrucEBNm7bL4hJmxbjljcYkbvBLRISBIVPw1IXdVk1Qdxa xEfmYiYQCKXUyQmg99rkqzTSSN7NnSh2fvcSNYjg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails Date: Fri, 07 Oct 2022 17:44:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: qinzhao at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D101836 --- Comment #42 from CVS Commits --- The master branch has been updated by Qing Zhao : https://gcc.gnu.org/g:b9ad850e86b863c24f6f4f5acf08d49944cc7bbe commit r13-3171-gb9ad850e86b863c24f6f4f5acf08d49944cc7bbe Author: Qing Zhao Date: Fri Oct 7 14:59:01 2022 +0000 Use array_at_struct_end_p in __builtin_object_size [PR101836] Use array_at_struct_end_p to determine whether the trailing array of a structure is flexible array member in __builtin_object_size. gcc/ChangeLog: PR tree-optimization/101836 * tree-object-size.cc (addr_object_size): Use array_at_struct_e= nd_p to determine a flexible array member reference. gcc/testsuite/ChangeLog: PR tree-optimization/101836 * gcc.dg/pr101836.c: New test. * gcc.dg/pr101836_1.c: New test. * gcc.dg/pr101836_2.c: New test. * gcc.dg/pr101836_3.c: New test. * gcc.dg/pr101836_4.c: New test. * gcc.dg/pr101836_5.c: New test. * gcc.dg/strict-flex-array-2.c: New test. * gcc.dg/strict-flex-array-3.c: New test.=