From: Eric Botcazou Date: Tue, 14 Sep 2021 09:14:37 +0000 (+0200) Subject: Do not issue size error for too large array type X-Git-Tag: releases/gcc-11.3.0~903 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a95c08c0de75a9114bc1c213d07866fc4663f1;p=thirdparty%2Fgcc.git 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 --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c71d0d6f396f..c27a4eb723e1 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -9133,8 +9133,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;