OSDN Git Service

Partial fix for too large arrays.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Aug 2005 23:52:22 +0000 (23:52 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Aug 2005 23:52:22 +0000 (23:52 +0000)
PR tree-optimization/21105
* decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for
array size check.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103363 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c

index 0ad264f..2501f58 100644 (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
index 9929eb6..4199b24 100644 (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