https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86532
--- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
const char a[2][3] = { "1234", "12" };
int main ()
{
{
volatile int i = 1;
int n = __builtin_strlen (a[i]);
n += __builtin_strlen (a[0]);
if (n != 3)
__builtin_abort ();
}
}
maybe you should look at this example, what is happening here?
I mean we know for sure that strlen is used on a non-zero terminated
value. especially if the initializer is exactly 3 characters wide,
it is even completely without warning, and yet __builtin_strlen (a[0])
seems to be folded to 4.