From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id CBF343858402; Tue, 14 Sep 2021 09:16:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBF343858402 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3520] Do not issue size error for too large array type X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: b9c35857d00c66158fcdf7de8adae4f06023052e X-Git-Newrev: f349a8b5928ec66cad91c00623db67e747be1600 Message-Id: <20210914091641.CBF343858402@sourceware.org> Date: Tue, 14 Sep 2021 09:16:41 +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: Tue, 14 Sep 2021 09:16:41 -0000 https://gcc.gnu.org/g:f349a8b5928ec66cad91c00623db67e747be1600 commit r12-3520-gf349a8b5928ec66cad91c00623db67e747be1600 Author: Eric Botcazou Date: Tue Sep 14 11:14:37 2021 +0200 Do not issue size error for too large array type The error is to be issued when objects of the type are declared instead. gcc/ada/ * gcc-interface/decl.c (validate_size): Do not issue an error if the old size has overflowed. Diff: --- gcc/ada/gcc-interface/decl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 20e3eea4cc5..0120b213a77 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -9191,8 +9191,7 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, /* Issue an error either if the default size of the object isn't a constant or if the new size is smaller than it. */ if (TREE_CODE (old_size) != INTEGER_CST - || TREE_OVERFLOW (old_size) - || tree_int_cst_lt (size, old_size)) + || (!TREE_OVERFLOW (old_size) && tree_int_cst_lt (size, old_size))) { char buf[128]; const char *s;