aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJames E Wilson <wilson@specifixinc.com>2005-08-16 11:23:58 -0700
committerJim Wilson <wilson@gcc.gnu.org>2005-08-16 11:23:58 -0700
commit355a9e437d6bffe505a1d5757f71dccd7f6e74f7 (patch)
tree294db0f3f5e2ca5c3887b056ddfe2e74d2890bed /gcc/c-decl.c
parent3881a11b4aaa2f38fe7024edcf83eb5238835506 (diff)
downloadgcc-355a9e437d6bffe505a1d5757f71dccd7f6e74f7.zip
gcc-355a9e437d6bffe505a1d5757f71dccd7f6e74f7.tar.gz
gcc-355a9e437d6bffe505a1d5757f71dccd7f6e74f7.tar.bz2
Emit an error for too large arrays instead of an ICE.
PR tree-optimization/21105 * c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in TREE_OVERFLOW check. * gcc.dg/large-size-array.c: New. From-SVN: r103164
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ff35e08..a1fdce7 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4384,7 +4384,7 @@ grokdeclarator (const struct c_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_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