(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
pr84982.c
       1  /* PR tree-optimization/84982 */
       2  /* { dg-do run } */
       3  /* { dg-options "-O2" } */
       4  
       5  #ifndef __cplusplus
       6  #define bool _Bool
       7  #define true 1
       8  #define false 0
       9  #endif
      10  
      11  struct S { bool a, b, c, d; };
      12  
      13  __attribute__((noipa)) void
      14  bar (bool *x)
      15  {
      16    if (x[0] || !x[1] || !x[2] || x[3])
      17      __builtin_abort ();
      18  }
      19  
      20  __attribute__((noipa)) void
      21  foo (struct S *x)
      22  {
      23    bool a[4];
      24    a[0] = !x->a;
      25    a[1] = !x->b;
      26    a[2] = x->c;
      27    a[3] = !x->d;
      28    bar (a);
      29  } 
      30  
      31  int
      32  main ()
      33  {
      34    struct S s;
      35    s.a = true; s.b = false; s.c = true; s.d = true;
      36    foo (&s);
      37    return 0;
      38  }