From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id BAAF03856DFA; Thu, 28 Jul 2022 12:35:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAAF03856DFA MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1875] middle-end/106457 - improve array_at_struct_end_p for array objects X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: f64eb636677d714781b4543f111b1c9239328db6 X-Git-Newrev: ff26f0ba68fe6e870f315d0601b596f889b89680 Message-Id: <20220728123554.BAAF03856DFA@sourceware.org> Date: Thu, 28 Jul 2022 12:35:54 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2022 12:35:54 -0000 https://gcc.gnu.org/g:ff26f0ba68fe6e870f315d0601b596f889b89680 commit r13-1875-gff26f0ba68fe6e870f315d0601b596f889b89680 Author: Richard Biener Date: Thu Jul 28 10:07:32 2022 +0200 middle-end/106457 - improve array_at_struct_end_p for array objects Array references to array objects are never at struct end. PR middle-end/106457 * tree.cc (array_at_struct_end_p): Handle array objects specially. Diff: --- gcc/tree.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/tree.cc b/gcc/tree.cc index 84000dd8b69..fed1434d141 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -12778,6 +12778,10 @@ array_at_struct_end_p (tree ref) && DECL_SIZE_UNIT (ref) && TREE_CODE (DECL_SIZE_UNIT (ref)) == INTEGER_CST) { + /* If the object itself is the array it is not at struct end. */ + if (DECL_P (ref_to_array)) + return false; + /* Check whether the array domain covers all of the available padding. */ poly_int64 offset;