diff options
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r-- | gcc/c/c-decl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 8170a80..f7ae648 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -7210,6 +7210,12 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes, layout_type (t); + if (TYPE_SIZE_UNIT (t) + && TREE_CODE (TYPE_SIZE_UNIT (t)) == INTEGER_CST + && !TREE_OVERFLOW (TYPE_SIZE_UNIT (t)) + && !valid_constant_size_p (TYPE_SIZE_UNIT (t))) + error ("type %qT is too large", t); + /* Give bit-fields their proper types. */ { tree *fieldlistp = &fieldlist; |