https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86955
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Blocks| |83819 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- The reason is that the strlen pass sees the following: _1 = &p_4(D)->a; __builtin_memcpy (_1, "123", 4); _2 = &MEM[(void *)p_4(D) + 2B]; _3 = __builtin_strlen (_2); and it doesn't understand that &MEM[(void *)p_4(D) + 2B] actually refers to p_4(D)->a. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83819 [Bug 83819] [meta-bug] missing strlen optimizations