https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63989
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org Blocks| |83819 --- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> --- In three out of the four test cases in comment #1 the strlen call is eliminated (GCC 8 and 9). The only one remaining is f3(): f3 (char * p) { char * _1; long unsigned int _2; int _7; <bb 2> [local count: 1073741825]: __builtin_memcpy (p_4(D), "foobar", 7); MEM[(char *)p_4(D) + 2B] = 0; _1 = p_4(D) + 3; _2 = __builtin_strlen (_1); _7 = (int) _2; return _7; } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83819 [Bug 83819] [meta-bug] missing strlen optimizations