1  /* { dg-do compile } */
       2  /* { dg-options "-Ofast -fdump-tree-dom2" } */
       3  
       4  void g (int);
       5  void g1 (int);
       6  
       7  void
       8  f (long a, long b, long c, long d, long x)
       9  {
      10    _Bool t;
      11    if (x)
      12      {
      13        g (a + 1);
      14        t = a < b;
      15        c = d + x;
      16      }
      17    else
      18      {
      19        g (b + 1);
      20        a = c + d;
      21        t = c > d;
      22      }
      23  
      24    if (t)
      25      g1 (c);
      26  
      27    g (a);
      28  }
      29  
      30  /* This is actually a regression.  The backward threader cannot thread
      31     the above scenario, but it is being caught by the DOM threader
      32     which still uses the forward threader.  We should implement this
      33     optimization in the backward threader before killing the forward
      34     threader.  Similarly for the other phi_on_compare-*.c tests.  */
      35  /* { dg-final { scan-tree-dump-times "Removing basic block" 1 "dom2" } } */