diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-05-23 10:51:18 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-05-23 10:51:18 +0000 |
commit | 03049a4e4057caafa15970e41be553a1043b643c (patch) | |
tree | 154f93a74c13b6793c95831abe456ce6dd5f9dec /gcc/ada/gcc-interface | |
parent | aae8570a44715ff724f31c3fc2442e5f69c929a7 (diff) | |
download | gcc-03049a4e4057caafa15970e41be553a1043b643c.zip gcc-03049a4e4057caafa15970e41be553a1043b643c.tar.gz gcc-03049a4e4057caafa15970e41be553a1043b643c.tar.bz2 |
decl.c (set_rm_size): Bypass the check for packed array types.
* gcc-interface/decl.c (set_rm_size): Bypass the check for packed array
types.
From-SVN: r147819
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index ca48c5a..e6f1d3a 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -7391,11 +7391,18 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) if (CONTAINS_PLACEHOLDER_P (old_size)) old_size = max_size (old_size, true); - /* If the size of the object is a constant, the new size must not be - smaller (the front-end checks this for scalar types). */ + /* If the size of the object is a constant, the new size must not be smaller + (the front-end has verified this for scalar and packed array types). */ if (TREE_CODE (old_size) != INTEGER_CST || TREE_OVERFLOW (old_size) - || (AGGREGATE_TYPE_P (gnu_type) && tree_int_cst_lt (size, old_size))) + || (AGGREGATE_TYPE_P (gnu_type) + && !(TREE_CODE (gnu_type) == ARRAY_TYPE + && TYPE_PACKED_ARRAY_TYPE_P (gnu_type)) + && !(TREE_CODE (gnu_type) == RECORD_TYPE + && TYPE_IS_PADDING_P (gnu_type) + && TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type))) == ARRAY_TYPE + && TYPE_PACKED_ARRAY_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_type)))) + && tree_int_cst_lt (size, old_size))) { if (Present (gnat_attr_node)) post_error_ne_tree |