From: James E Wilson Date: Mon, 22 Aug 2005 23:52:22 +0000 (-0700) Subject: Partial fix for too large arrays. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96ce2ac9e860d7d96cb381396a4c1f72f418e000;p=gcc.git Partial fix for too large arrays. PR tree-optimization/21105 * decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for array size check. From-SVN: r103363 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0ad264f6798..2501f5825c4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-08-22 James E Wilson + + PR tree-optimization/21105 + * decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for + array size check. + 2005-08-22 Volker Reichelt PR c++/22233 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9929eb6b2c2..4199b241b9b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7556,8 +7556,8 @@ grokdeclarator (const cp_declarator *declarator, if (TREE_CODE (type) == ARRAY_TYPE && COMPLETE_TYPE_P (type) - && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && TREE_OVERFLOW (TYPE_SIZE (type))) + && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST + && TREE_OVERFLOW (TYPE_SIZE_UNIT (type))) { error ("size of array %qs is too large", name); /* If we proceed with the array type as it is, we'll eventually