(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr86835.c
       1  /* PR tree-optimization/86835 */
       2  /* { dg-do run } */
       3  /* { dg-options "-O2 -ffast-math -Wuninitialized" } */
       4  
       5  __attribute__((noipa)) void
       6  foo (int n, double *x, double *y)
       7  {		/* { dg-bogus "is used uninitialized in this function" "" { target *-*-* } 0 } */
       8    int i;
       9    double b = y[4];
      10    for (i = 0; i < n; ++i)
      11      y[3] += __builtin_sin (x[i] / b);
      12    y[0] /= b;
      13    y[1] /= b * b;
      14    y[2] /= b;
      15  }
      16  
      17  int
      18  main ()
      19  {
      20    double y[] = { 16.0, 64.0, 128.0, 0.0, 2.0 };
      21    foo (0, y, y);
      22    if (__builtin_fabs (y[0] - 8.0) > 0.0001
      23        || __builtin_fabs (y[1] - 16.0) > 0.0001
      24        || __builtin_fabs (y[2] - 64.0) > 0.0001
      25        || y[3] != 0.0
      26        || y[4] != 2.0)
      27      __builtin_abort ();
      28    return 0;
      29  }