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
+2019-09-26 Alexandre Oliva <oliva@adacore.com>
+
+ * gcc-interface/decl.c (components_to_record): Set
+ DECL_SIZE_UNIT for zero-sized fields.
+
2019-09-26 Arnaud Charlet <charlet@adacore.com>
* osint.adb (OS_Time_To_GNAT_Time): Remove dependency on To_C/To_Ada
if (DECL_SIZE (gnu_field) && integer_zerop (DECL_SIZE (gnu_field)))
{
+ DECL_SIZE_UNIT (gnu_field) = size_zero_node;
DECL_FIELD_OFFSET (gnu_field) = size_zero_node;
SET_DECL_OFFSET_ALIGN (gnu_field, BIGGEST_ALIGNMENT);
DECL_FIELD_BIT_OFFSET (gnu_field) = bitsize_zero_node;