https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102285
--- Comment #26 from qinzhao at gcc dot gnu.org ---
(In reply to qinzhao from comment #25)
> (In reply to Richard Biener from comment #22)
> > Hmm, my proposed patch seems to work. I've adjusted it to not regress
> > previously correctly handled cases and will test it fully.
>
> I guess the reason for it worked for you because you tested it after the
> patch for 102587?
>
> --- a/gcc/internal-fn.c
> +++ b/gcc/internal-fn.c
> @@ -3035,7 +3035,8 @@ expand_DEFERRED_INIT (internal_fn, gcall *stmt)
> /* Expand this memset call. */
> expand_builtin_memset (m_call, NULL_RTX, TYPE_MODE (var_type));
> }
> - else
> + /* ??? Deal with poly-int sized registers. */
> + else if (tree_fits_uhwi_p (TYPE_SIZE_UNIT (var_type)))
> {
> /* If this variable is in a register, use expand_assignment might
> generate better code. */
because for the following IR:
MEM[(int[0:D.1993] *)&fb.3] = .DEFERRED_INIT (16, 2, 1);
The "var_type" of the LHS is "int[0:D.1993]", which is not an integer constant
(even though the type for fb.3 should be the new type for the new temporary
variable char[16]).
As a result, the new added check
> + /* ??? Deal with poly-int sized registers. */
> + else if (tree_fits_uhwi_p (TYPE_SIZE_UNIT (var_type)))
excluded it from expanding through expand_assign.