1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fdump-tree-ethread-details -w --param logical-op-non-short-circuit=1" } */
       3  
       4  // Copied from ssa-dom-thread-14.c
       5  
       6  enum optab_methods
       7  {
       8    OPTAB_DIRECT,
       9    OPTAB_LIB,
      10    OPTAB_WIDEN,
      11    OPTAB_LIB_WIDEN,
      12    OPTAB_MUST_WIDEN
      13  };
      14  struct optab_d { };
      15  typedef struct optab_d *optab;
      16  void
      17  expand_shift_1 (int code, int unsignedp, int rotate,
      18  		optab lshift_optab, optab rshift_arith_optab)
      19  {
      20    int left = (code == 42 || code == 0xde);
      21    int attempt;
      22    enum optab_methods methods;
      23    if (attempt == 0)
      24      methods = OPTAB_DIRECT;
      25    else if (attempt == 1)
      26      methods = OPTAB_WIDEN;
      27    if ((!unsignedp || (!left && methods == OPTAB_WIDEN)))
      28      {
      29        enum optab_methods methods1 = methods;
      30        if (unsignedp)
      31  	methods1 = OPTAB_MUST_WIDEN;
      32        expand_binop (left ? lshift_optab : rshift_arith_optab,
      33  			   unsignedp, methods1);
      34      }
      35  }
      36  
      37  /* When UNSIGNEDP is true, LEFT is false and METHOD == OPTAB_WIDEN
      38     we will enter the TRUE arm of the conditional and we can thread
      39     the test to compute the first first argument of the expand_binop
      40     call if we look backwards through the boolean logicals.  */
      41  /* { dg-final { scan-tree-dump-times "Registering.*jump thread" 1 "ethread"} } */