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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase (unfortunately reduced into a form which is x86_64-linux
specific unless I want success to be an endless loop)
with -O2 -mavx -mtune=znver1 -ftrivial-auto-var-init=zero:

int a, b, c, d, e, f, g, h, i, j, k;
int *m;
int **l = &m;

static void
bar (void)
{
l:
  if (j)
    for (;;)
      ;
  short q[3];
  if (g)
    goto l;
  for (; k; k -= 1)
    {
      int *r = &g;
      *r = i;
      for (f = 0; f <= 6; f += 1)
        {
          if (*l)
            {
              d += 1;
              for (; d;)
                ;
            }
          if (e)
            break;
        }
    }
}

__attribute__((noipa)) void
foo (int *x)
{
  int n;
  long o = 1;
  if (*x)
    {
      bar ();
      ++o;
      n = a / o;
    }
  h |= n;
  for (;;)
    {
      int *p[4];
      *l = x;
      for (b = 0; b <= 2; b += 1)
        if (c)
          {
            asm ("pushq %rbp; xorl %edi, %edi; movq %rsp, %rbp; andq $-16,
%rsp; call exit");
            break;
          }
        else
          *m = 0;
    }
}

int
main ()
{
  int x = 1;
  c = 1;
  foo (&x);
  return 0;
}

Started (or perhaps no longer latent) since
r13-4839-geef81eefcdc2a58111e50eb21.

Reply via email to