aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-06-19 16:55:22 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-06-19 16:55:22 +0000
commit6414bad6d74db5a12d6dee4124309bb0e823c7fc (patch)
tree4115c5e8551c3d8c8c3f4e3245384e64b6e75c67 /gcc/c-decl.c
parente364ab3ab7e21141218956a59dba88f04c34f8b9 (diff)
downloadgcc-6414bad6d74db5a12d6dee4124309bb0e823c7fc.zip
gcc-6414bad6d74db5a12d6dee4124309bb0e823c7fc.tar.gz
gcc-6414bad6d74db5a12d6dee4124309bb0e823c7fc.tar.bz2
c-decl.c (grokdeclarator): Only check TREE_OVERFLOW on INTEGER_CST nodes.
* c-decl.c (grokdeclarator): Only check TREE_OVERFLOW on INTEGER_CST nodes. * c-typeck.c (build_c_cast): Only preserve TREE_OVERFLOW on CONSTANT_CLASS_P nodes. From-SVN: r101187
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 8f50b17..b126023 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4192,7 +4192,8 @@ grokdeclarator (const struct c_declarator *declarator,
index_type, before the subtraction. Handling
this case seems like an unnecessary
complication. */
- if (TREE_OVERFLOW (itype))
+ if (TREE_CODE (itype) == INTEGER_CST
+ && TREE_OVERFLOW (itype))
{
error ("size of array %qs is too large", name);
type = error_mark_node;
@@ -4357,6 +4358,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)))
{
error ("size of array %qs is too large", name);