1  /* { dg-do run } */
       2  /* { dg-options "-O -fdump-tree-phiopt" } */
       3  
       4  #include <stdint.h>
       5  
       6  __attribute__ ((noinline, noipa))
       7  uint8_t three_minmax3 (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) (xy < xc ? 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 = 0;
      25    volatile uint8_t xc = 127;
      26    if (three_minmax3 (xc, xm, xy) != 0)
      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" } } */