https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126980
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |middle-end
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
gimplify_init_constructor has
/* Do a block move either if the size is so small as to make
each individual move a sub-unit move on average, or if it
is so large as to make individual moves inefficient. */
if (size > 0
&& num_nonzero_elements > 1
/* For ctors that have many repeated nonzero elements
represented through RANGE_EXPRs, prefer initializing
those through runtime loops over copies of large amounts
of data from readonly data section. */
&& (num_unique_nonzero_elements
> num_nonzero_elements / unique_nonzero_ratio
|| size <= min_unique_size)
&& (size < num_nonzero_elements
|| !can_move_by_pieces (size, align)))
{
It assumes the data size (the code size) is small and calls
gimplify_init_constructor if can_move_by_pieces returns true.
But when constructor is used, move_by_pieces won't be used
and the code size may not be small.