set DECL_SIZE_UNIT for zero-sized fields
authorAlexandre Oliva <oliva@adacore.com>
Fri, 27 Sep 2019 01:59:55 +0000 (01:59 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 27 Sep 2019 01:59:55 +0000 (01:59 +0000)
commit639a28ba6e0e5807ae062475f35cc6895e32ef17
tree8357cec521fab8b93a5e2ebb697ae8dcd3877b67
parent09704140c7f3e4341d66a32e40359c4d146a4350
set DECL_SIZE_UNIT for zero-sized fields

Zero-sized fields do not get processed by finish_record_type: they're
removed from the field list before and reinserted after, so their
DECL_SIZE_UNIT remains unset, causing the translation of assignment
statements with use_memset_p, in quite unusual circumstances, to use a
NULL_TREE as the memset length.  This patch sets DECL_SIZE_UNIT for
the zero-sized fields, that don't go through language-independent
layout, in language-specific layout.

for  gcc/ada/ChangeLog

* gcc-interface/decl.c (components_to_record): Set
DECL_SIZE_UNIT for zero-sized fields.

From-SVN: r276173
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c