https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- If they want to optimize based on the size of the array then disable the builtin (and don't use The __builtin_ specific function). Basically this code is undefined and can do anything. If anything maybe strnlen should be used instead...