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
This commit is contained in:
James E Wilson 2005-08-22 16:52:22 -07:00 committed by Jim Wilson
parent 10cbe699ce
commit 96ce2ac9e8
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-08-22 James E Wilson <wilson@specifix.com>
PR tree-optimization/21105
* decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for
array size check.
2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22233

View File

@ -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