https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88780
--- Comment #16 from Jeffrey A. Law <law at gcc dot gnu.org> --- Some thoughts. The block with the key statements looks like: <bb 4> : __builtin_strncpy (d_8(D), s_5(D), len_6); _2 = d_8(D) + len_6; *_2 = 0; We probably need to recover the array indexing and produce the equivalent of <bb 4> : __builtin_strncpy (d_8(D), s_5(D), len_6); d[len_6] = 0; Then we probably need to factor the hack that looks past the strncpy so that it works in maybe_diag_stxncpy_trunc. Probably not gcc-15 material, but that's a path forward.