(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr108359.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fdump-tree-optimized" } */
       3  
       4  /* PR test case.  */
       5  int b = 10;
       6  int c;
       7  char e;
       8  void foo();
       9  static char(a)(char f, char g) { return f && g == 1 ? 0 : f % g; }
      10  short(d)(short f, short g) { return f * g; }
      11  int main() {
      12    short h;
      13    int i;
      14    unsigned j;
      15    h = d(b && c, 5);
      16    j = h;
      17    i = a(h, 237);
      18    unsigned k = i;
      19    e = i < 0 || k >= 32 ? 0 : i >> k;
      20    if (e) {
      21      c = 0;
      22      foo();
      23    }
      24  }
      25  
      26  
      27  /* Also Check that small ranges are broken down and optimized properly
      28     This function should never call foo ().  */
      29  
      30  int otherfunc (int x, int z) {
      31    if (x < 1 || x > 6 )
      32      return 0;
      33  
      34    if (x == z)
      35      {
      36      if (x >> z > 0)
      37        foo ();
      38      if (x * z > 26 && x * z < 35)
      39        foo ();
      40      if (x + z == 5)
      41        foo ();
      42      if ((x + z) % 2 == 1)
      43        foo ();
      44      if (x / z != 1)
      45        foo ();
      46  
      47      }
      48    return 0;
      49  }
      50  
      51  
      52  /* { dg-final { scan-tree-dump-not "foo" "optimized" } } */