(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tree-ssa/
pr59597.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-Ofast -fdisable-tree-cunrolli -fdump-tree-threadfull1-details" } */
       3  
       4  typedef unsigned short u16;
       5  typedef unsigned char u8;
       6  typedef unsigned int u32;
       7  __extension__ typedef __INT32_TYPE__ i32;
       8  
       9  long int random(int);
      10  #define NNN 10
      11  
      12  u32 f[NNN], t[NNN];
      13  
      14  static u16
      15  Calc_crc8 (u8 data, u16 crc)
      16  {
      17    u8 i=0,x16=0,carry=0;
      18    for (i = 0; i < 8; i++)
      19      {
      20        x16 = (u8)((data & 1) ^ ((u8)crc & 1));
      21        data >>= 1;
      22   
      23        if (x16 == 1)
      24  	{
      25  	  crc ^= 0x4002;
      26  	  carry = 1;
      27  	}
      28        else
      29  	carry = 0;
      30        crc >>= 1;
      31        if (carry)
      32  	crc |= 0x8000;
      33        else
      34  	crc &= 0x7fff;
      35      }
      36    return crc;
      37  }
      38  
      39  int
      40  main (int argc, char argv[])
      41  {
      42    int i; i32 j; u16 crc;
      43    for (j = 0; j < 10000000; j++)
      44      {
      45        for (i = 0; i < NNN; i++)
      46  	{
      47  	  f[i] = random(i);
      48  	  t[i] = random(NNN - i - 1);
      49  	}
      50        for (i=0; i<NNN; i++) 
      51  	{
      52  	  crc=Calc_crc8(f[i],(u16)argc);
      53  	  crc=Calc_crc8(t[i],crc);
      54  	}
      55      }
      56    return crc;
      57  }
      58  
      59  /* We used to have no threads in vrp-thread1 because all the attempted
      60     ones would cross loops.  Now we get 30+ threads before VRP because
      61     of loop unrolling.  A better option is to disable unrolling and
      62     test for the original 4 threads that this test was testing.  */
      63  /* { dg-final { scan-tree-dump-times "Registering jump thread" 4 "threadfull1" } } */