https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122035 --- Comment #16 from Andrew Pinski <pinskia at gcc dot gnu.org> --- As I mentioned at -O2, the undefined behavior is removed as we can figure out strlen(&a) is always 0.