1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fno-tree-forwprop -fdump-tree-evrp-details -fdump-tree-optimized -fno-tree-ccp --param logical-op-non-short-circuit=1" } */
       3  
       4  
       5  struct rtx_def;
       6  typedef struct rtx_def *rtx;
       7  union rtunion_def
       8  {
       9    rtx rt_rtx;
      10  };
      11  typedef union rtunion_def rtunion;
      12  struct rtx_def
      13  {
      14    int code;
      15    union u
      16    {
      17      rtunion fld[1];
      18    } u;
      19  };
      20  
      21  void arf (void);
      22  void nit (void);
      23  void frob (void);
      24  
      25  void
      26  sss (rtx insn, int code1, int code2, int code3)
      27  {
      28    _Bool D1562;
      29    struct rtx_def * body;
      30    int i;
      31    int n_sets;
      32    int D1544;
      33  
      34    body = insn->u.fld[5].rt_rtx;
      35    D1544 = body->code;
      36    n_sets = 1;
      37    if (D1544 == 55) goto L7; else goto L1;
      38  
      39  L1:
      40    n_sets = 0;
      41    if (code3 == 99) goto L2; else goto L11;
      42  
      43  L2:
      44    D1562 = code1 == 10;
      45    n_sets = (int) D1562;
      46    if (n_sets > 0) goto L7; else goto L11;
      47  
      48  L37:
      49    if (code2 == 42) goto L8; else goto L9;
      50  
      51  L8:
      52    arf ();
      53  
      54  L9:
      55    i = i + 1;
      56    if (i < n_sets) goto L37; else goto L32;
      57  
      58  L32:
      59  
      60  L11:
      61    if (n_sets > 1) goto L12; else goto L15;
      62  
      63  L12:
      64    nit ();
      65  
      66  L14:
      67    i = 0;
      68    goto L38;
      69  
      70  L15:
      71    if (n_sets > 0) goto L14; else goto L16;
      72  
      73  L38:
      74    frob ();
      75    i = i + 1;
      76    if (n_sets > i) goto L38; else goto L16;
      77  
      78  L16:
      79    return;
      80  
      81  L7:
      82    i = 0;
      83    goto L37;
      84  
      85  }
      86  
      87  /* The first n_sets > 0 test can be simplfiied into n_sets == 1 since
      88     n_sets can only have the values [0, 1] as it's the result of a
      89     boolean operation.  */
      90  
      91  /* { dg-final { scan-tree-dump-times "Simplified relational" 2 "evrp" } } */
      92  /* { dg-final { scan-tree-dump-times "if " 3 "optimized" } } */
      93