(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tree-ssa/
minmax-13.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O -fdump-tree-phiopt" } */
       3  
       4  #include <stdint.h>
       5  
       6  __attribute__ ((noipa, noinline))
       7  uint8_t three_minmax2 (uint8_t xc, uint8_t xm, uint8_t xy) {
       8  	uint8_t	 xk;
       9      xc=~xc;
      10      xm=~xm;
      11      xy=~xy;
      12      if (xc > xm) {
      13          xk = (uint8_t) (xc > xy ? xc : xy);
      14      } else {
      15          xk = (uint8_t) (xm < xy ? xm : xy);
      16      }
      17      return xk;
      18  }
      19  
      20  int
      21  main (void)
      22  {
      23    volatile uint8_t xy = 255;
      24    volatile uint8_t xm = 127;
      25    volatile uint8_t xc = 0;
      26    if (three_minmax2 (xc, xm, xy) != 255)
      27      __builtin_abort ();
      28    return 0;
      29  }
      30  
      31  /* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */
      32  /* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */