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

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #10)
>   __builtin_memcpy (&D.35539.D.25336._M_local_buf, "abc", 3);
>   MEM[(char_type &)&D.35539 + 11] = 0;
> change to
>   __builtin_memcpy (&D.35539.D.25336._M_local_buf, "abc", 4);
> seems like something that the strlen pass could do.

Actually it is closely related to what simplify_builtin_memcpy_memset
(r0-103686-gf46842422035db) does.

Maybe I will look into next month.

Reply via email to