public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-10122] Do not issue size error for too large array type
@ 2021-09-14 9:18 Eric Botcazou
0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-09-14 9:18 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:215e674de7f65c6c5b79b244ab4cd9dcf5cc7aa6
commit r10-10122-g215e674de7f65c6c5b79b244ab4cd9dcf5cc7aa6
Author: Eric Botcazou <ebotcazou@adacore.com>
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 80107a69060..8b221bc1363 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -9044,8 +9044,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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-14 9:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 9:18 [gcc r10-10122] Do not issue size error for too large array type Eric Botcazou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).