[Bug tree-optimization/97960] [8/9/10/11 Regression] Wrong code at -O3 since r8-6511-g3ae129323d

acoplan at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 23 17:53:58 GMT 2020


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

--- Comment #1 from Alex Coplan <acoplan at gcc dot gnu.org> ---
C testcase:

const int *c(const int *p, const int *q)
{
  if (*p < *q)
    return q;
  return p;
}

short a[575];
unsigned b[25];
unsigned char g;
int main()
{
  for (int e = 0; e < 23; ++e)
    a[e * 23] = 16137;

  int t1 = g;
  int t2 = 253;
  signed char h = *c(&t1, &t2) + 3;

  for (; h < 24; h++)
    b[h] = 1064739102;

  for (int e = 0; e < 23; ++e)
    if (a[e * 23] != 16137)
      __builtin_abort();
}


More information about the Gcc-bugs mailing list