diff options
author | James E Wilson <wilson@specifixinc.com> | 2005-08-22 16:52:22 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2005-08-22 16:52:22 -0700 |
commit | 96ce2ac9e860d7d96cb381396a4c1f72f418e000 (patch) | |
tree | 331294c1c74dc846b9a76b0b2c81043ccc082808 /gcc | |
parent | 10cbe699ce996e5586dd69e449a828db700f910d (diff) | |
download | gcc-96ce2ac9e860d7d96cb381396a4c1f72f418e000.zip gcc-96ce2ac9e860d7d96cb381396a4c1f72f418e000.tar.gz gcc-96ce2ac9e860d7d96cb381396a4c1f72f418e000.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0ad264f..2501f58 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9929eb6..4199b24 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 |