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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Perhaps it would be enough to just disable the pass for now (comment out in the
gate), so that the whole file isn't reverted.

It breaks i686-linux bootstrap as well, on the following testcase reduced from
vec.c:
struct A
{
  const char *a;
  int b;
  const char *c;
};
void bar (char *);

void
foo (struct A *p)
{
  char s[4096];
  const char *u = p->a;
  const char *t;
  while ((t = __builtin_strstr (u, "gcc/")))
    u = t + 4;
  __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
  bar (s);
}
I'm getting with -O2 -Wformat-length -m32:
vec.c: In function ‘foo’:
vec.c:17:26: warning: ‘%s’ directive writing between 0 and 4294967295 bytes
into a region of size 4096 [-Wformat-length=]
   __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
                          ^~
vec.c:17:3: note: format output between 6 and 4294967311 bytes into a
destination of size 4096
   __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
while no warnings at -O2 -Wformat-length -m64.

Reply via email to