(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr63661.c
       1  /* PR target/63661 */
       2  /* { dg-do run } */
       3  /* { dg-require-effective-target fpic } */
       4  /* { dg-options "-mtune=nehalem -fPIC -O2" } */
       5  
       6  static void __attribute__((noinline,noclone,hot))
       7  foo (double a, double q, double *ff, double *gx, int e, int ni)
       8  {
       9    union
      10      {
      11        double n;
      12        unsigned long long o;
      13      } punner;
      14    double d;
      15  
      16    punner.n = q;
      17     __builtin_printf("B: 0x%016llx ---- %g\n", punner.o, q);
      18  
      19    d = q - 5;
      20    if(d < 0)
      21      d = -d;
      22    if (d > 0.1)
      23      __builtin_abort();
      24  }
      25  
      26  static int __attribute__((noinline,noclone,hot))
      27  bar (int order, double q, double c[])
      28  {
      29    int ni, nn, i, e;
      30    double g2, x2, de, s, ratio, ff;
      31  
      32    nn = 0;
      33    e = order & 1;
      34    s = 0;
      35    ratio = 0;
      36    x2 = 0;
      37    g2 = 0;
      38  
      39    if(q == 0.0)
      40      return 0;
      41  
      42    if (order < 5)
      43      {
      44        ratio = 1.0 / q;
      45        nn = order;
      46      }
      47  
      48    ni = -nn;
      49  
      50    while(1)
      51      {
      52        de = ratio - g2 - x2;
      53  
      54        foo (0, q, &ff, &g2, e, ni);
      55  
      56        if((int)de == 0)
      57          break;
      58      }
      59  
      60    s += 2 * nn * c[nn];
      61  
      62    for (i = 0; i < 1; i++)
      63      {
      64        c[0] = nn;
      65        for (; i < 10; i++)
      66          c[i] = 0.0;
      67        c[0] /= s;
      68      }
      69  
      70    return 0;
      71  }
      72  
      73  int
      74  main ()
      75  {
      76    double c[1000];
      77  
      78    bar (1, 5.0, c);
      79    return 0;
      80  }