diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-09-06 15:39:48 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-09-06 09:39:48 -0600 |
commit | 6d9001072d3ed5a82b8277426e6dd41a1c605990 (patch) | |
tree | f152a5f3a4863b32753531cb6e74a16358a52921 /gcc/varasm.c | |
parent | 6847c656b4153fbd0b552ac5051dc7b3ec44246a (diff) | |
download | gcc-6d9001072d3ed5a82b8277426e6dd41a1c605990.zip gcc-6d9001072d3ed5a82b8277426e6dd41a1c605990.tar.gz gcc-6d9001072d3ed5a82b8277426e6dd41a1c605990.tar.bz2 |
varasm.c (output_constructor_regular_field): Check TYPE_SIZE_UNIT of the init value.
* varasm.c (output_constructor_regular_field): Check TYPE_SIZE_UNIT of
the init value.
* c-common.c (complete_flexible_array_elts): New helper function.
* c-common.h (complete_flexible_array_elts): Declare.
* c-decl.c (finish_decl): Call complete_flexible_array_elts.
* decl.c (check_initializer): Call cp_complete_array_type.
From-SVN: r264147
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 2180da4..27d878f 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5160,6 +5160,8 @@ output_constructor_regular_field (oc_local_state *local) on the chain is a TYPE_DECL of the enclosing struct. */ const_tree next = DECL_CHAIN (local->field); gcc_assert (!fieldsize || !next || TREE_CODE (next) != FIELD_DECL); + tree size = TYPE_SIZE_UNIT (TREE_TYPE (local->val)); + gcc_checking_assert (compare_tree_int (size, fieldsize) == 0); } else fieldsize = tree_to_uhwi (DECL_SIZE_UNIT (local->field)); |