https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70931

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.4

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think this is a corner-case of native_encode_initializer not handling
zero-sized FIELD_DECLs.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c     (revision 235859)
+++ gcc/dwarf2out.c     (working copy)
@@ -17806,7 +17806,7 @@ native_encode_initializer (tree init, un
              fieldsize = tree_to_shwi (DECL_SIZE_UNIT (field));
              pos = int_byte_position (field);
              gcc_assert (pos + fieldsize <= size);
-             if (val
+             if (val && fieldsize != 0
                  && !native_encode_initializer (val, array + pos, fieldsize))
                return false;
            }

fixes it.

Reply via email to