1  /* { dg-do compile } */ 
       2  /* { dg-options "-O2 -fdump-tree-thread1-details -w" } */
       3  
       4  // Copied from ssa-dom-thread-12.c.
       5  
       6  typedef long unsigned int size_t;
       7  union tree_node;
       8  typedef union tree_node *tree;
       9  typedef union gimple_statement_d *gimple;
      10  typedef const union gimple_statement_d *const_gimple;
      11  union gimple_statement_d
      12  {
      13    unsigned num_ops;
      14    tree exp;
      15  };
      16  
      17  unsigned int x;
      18  static inline tree
      19  gimple_op (const_gimple gs, unsigned i)
      20  {
      21    if (!(i < gs->num_ops))
      22      abort ();
      23    return gs->exp;
      24  }
      25  
      26  unsigned char
      27  scan_function (gimple stmt)
      28  {
      29    unsigned i;
      30    for (i = 0; i < stmt->num_ops - 3 ; i++)
      31      gimple_call_arg (stmt, i);
      32    gimple_op (stmt, 1);
      33  }
      34  
      35  /* The test which bypasses the loop is simplified prior to DOM to check
      36     that stmt->num_ops - 3 != 0.  When that test is false, we can derive
      37     a value for stmt->num_ops.  That in turn allows us to thread the jump
      38     for the conditional at the start of the call to gimple_op.  */
      39  /* { dg-final { scan-tree-dump-times "Registering.*jump thread" 1 "thread1"} } */