This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to gimplify_init_constructor for c++/38410
New patch (relative to the code before my last patch):
Tested x86_64-pc-linux-gnu, applied to trunk.
2008-12-09 Jason Merrill <jason@redhat.com>
* gimplify.c (gimplify_init_constructor): Revert to using < rather
than <= for sparseness test.
Index: gimplify.c
===================================================================
*** gimplify.c (revision 142579)
--- gimplify.c (working copy)
*************** gimplify_init_constructor (tree *expr_p,
*** 3582,3589 ****
be dropped to memory, and then memcpy'd out. Don't do this
for sparse arrays, though, as it's more efficient to follow
the standard CONSTRUCTOR behavior of memset followed by
! individual element initialization. */
! if (valid_const_initializer && !cleared)
{
HOST_WIDE_INT size = int_size_in_bytes (type);
unsigned int align;
--- 3582,3594 ----
be dropped to memory, and then memcpy'd out. Don't do this
for sparse arrays, though, as it's more efficient to follow
the standard CONSTRUCTOR behavior of memset followed by
! individual element initialization. Also don't do this for small
! all-zero initializers (which aren't big enough to merit
! clearing), and don't try to make bitwise copies of
! TREE_ADDRESSABLE types. */
! if (valid_const_initializer
! && !(cleared || num_nonzero_elements == 0)
! && !TREE_ADDRESSABLE (type))
{
HOST_WIDE_INT size = int_size_in_bytes (type);
unsigned int align;