(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
pr58984.c
       1  /* PR tree-optimization/58984 */
       2  
       3  struct S { int f0 : 8; int : 6; int f1 : 5; };
       4  struct T { char f0; int : 6; int f1 : 5; };
       5  
       6  int a, *c = &a, e, n, b, m;
       7  
       8  static int
       9  foo (struct S p)
      10  {
      11    const unsigned short *f[36];
      12    for (; e < 2; e++)
      13      {
      14        const unsigned short **i = &f[0];
      15        *c ^= 1;
      16        if (p.f1)
      17  	{
      18  	  *i = 0;
      19  	  return b;
      20  	}
      21      }
      22    return 0;
      23  }
      24  
      25  static int
      26  bar (struct T p)
      27  {
      28    const unsigned short *f[36];
      29    for (; e < 2; e++)
      30      {
      31        const unsigned short **i = &f[0];
      32        *c ^= 1;
      33        if (p.f1)
      34  	{
      35  	  *i = 0;
      36  	  return b;
      37  	}
      38      }
      39    return 0;
      40  }
      41  
      42  int
      43  main ()
      44  {
      45    struct S o = { 1, 1 };
      46    foo (o);
      47    m = n || o.f0;
      48    if (a != 1)
      49      __builtin_abort ();
      50    e = 0;
      51    struct T p = { 1, 1 };
      52    bar (p);
      53    m |= n || p.f0;
      54    if (a != 0)
      55      __builtin_abort ();
      56    return 0;
      57  }