https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129157

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
fold_binary for TRUNC_MOD_EXPR gets:
<<< Unknown tree: c_maybe_const_expr

  c >>> != 0 ? (long long unsigned int) (0 - 18446744073709551488) : 0

as op0.

extract_muldiv_1 has this mess:
```
    case PLUS_EXPR:  case MINUS_EXPR:
      /* See if we can eliminate the operation on both sides.  If we can, we
         can return a new PLUS or MINUS.  If we can't, the only remaining
         cases where we can do anything are if the second operand is a
         constant.  */
      t1 = extract_muldiv (op0, c, code, wide_type);
      t2 = extract_muldiv (op1, c, code, wide_type);
      if (t1 != 0 && t2 != 0
          && TYPE_OVERFLOW_WRAPS (ctype)
          && (code == MULT_EXPR
              /* If not multiplication, we can only do this if both operands
                 are divisible by c.  */
              || (multiple_of_p (ctype, op0, c)
                  && multiple_of_p (ctype, op1, c))))
        {
          return fold_build2 (tcode, ctype, fold_convert (ctype, t1),
                              fold_convert (ctype, t2));
        }
```

Which I feel like this might be broken here for this case.

Reply via email to