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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I tried all drivers of this code and I can't get it to fail:.

E.g.:

struct f {
Token a[1028];
};

int main()
{
  char *tt1 = (char*)calloc (1, sizeof(f)*4*1024);
  unsigned long long o = (unsigned long long)tt1;
  o += 4096 - o%4096;
  char *tt = (char*)o;
  for(int lp = 0; lp < 4096; lp++) {
  struct f *b = (struct f *)(tt+lp);
  Token *a = b->a;
  unsigned long long t = (unsigned long long)a;
 // printf("%llx:%x.\n", t, (int)alignof(Token));
  for(int i = 0; i < 1023; i++)
  {
    for(int j = 0; j < 1024; j++)
      a[j].Kind = (decltype(a[j].Kind))(j+2);
    a[i].Kind = tok::eof;
    unsigned t = getArgLength (a);
    if (t != i)
      __builtin_printf("%d\n", t);
  }
  }
}

Reply via email to