https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125079
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Better testcase without includes showing both cases:
typedef __SIZE_TYPE__ size_t;
void foo (char *, int);
char *stpcpy (char *, const char *);
size_t
bar (char *r)
{
char buf[64];
foo (buf, 0);
size_t ret = __builtin_strlen (buf);
__builtin___strcat_chk (buf, r, 64);
foo (buf, 1);
return ret;
}
size_t
baz (char *r)
{
char buf[64];
foo (buf, 2);
__builtin___strcat_chk (buf, r, 64);
size_t ret = __builtin_strlen (buf);
foo (buf, 3);
return ret;
}