https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89230
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So what is happening here is GCC does not know the properties of sprintf/printf to know they can't modify memory therefor GCC cannot figure out d->D_fid[2] does not change from the first if statement to the second one.