[Bug tree-optimization/83190] missing strlen optimization of the empty string

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 28 04:32:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83190

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
sizeof "012\0" is 5.  There are two NULs at the end, one explicit in the
initializer string and one implicitly appended by the compiler.

That the size is 5 can also be seen in the dump of g():

g ()
{
  char a[5];
  ...
}


More information about the Gcc-bugs mailing list