diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1997-07-14 07:26:35 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1997-07-14 07:26:35 -0400 |
commit | 506711af80cb7a45f567dfd3502647aad0465637 (patch) | |
tree | ccb264bc55345ce089073dfa127eee3aa7f19935 /gcc/varasm.c | |
parent | 9ddca353b96f567da5733851dfb028ccdffb9156 (diff) | |
download | gcc-506711af80cb7a45f567dfd3502647aad0465637.zip gcc-506711af80cb7a45f567dfd3502647aad0465637.tar.gz gcc-506711af80cb7a45f567dfd3502647aad0465637.tar.bz2 |
(assemble_variable): If low part of size doesn't fit in an int,
variable is too large.
From-SVN: r14428
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 29257dd..dae2662 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1272,6 +1272,8 @@ assemble_variable (decl, top_level, at_end, dont_output_data) if (! dont_output_data) { + int size; + if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) goto finish; @@ -1279,7 +1281,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data) size_tree = size_binop (CEIL_DIV_EXPR, DECL_SIZE (decl), size_int (BITS_PER_UNIT)); - if (TREE_INT_CST_HIGH (size_tree) != 0) + size = TREE_INT_CST_LOW (size_tree); + if (TREE_INT_CST_HIGH (size_tree) != 0 + || size != TREE_INT_CST_LOW (size_tree)) { error_with_decl (decl, "size of variable `%s' is too large"); goto finish; |