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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
And it's fine, but re-writing -1 - _107 to -_107 + -1 is not valid. Negating
_107, that is, as done by build_symbolic_expr via

          /* If the result lower bound is constant, we're done;
             otherwise, build the symbolic lower bound.  */
          if (sym_min_op0 == sym_min_op1)
            ;
          else if (sym_min_op0)
            min = build_symbolic_expr (expr_type, sym_min_op0,
                                       neg_min_op0, min);
          else if (sym_min_op1)
            min = build_symbolic_expr (expr_type, sym_min_op1,
                                       neg_min_op1 ^ minus_p, min);

          /* Likewise for the upper bound.  */
          if (sym_max_op0 == sym_max_op1)
            ;
          else if (sym_max_op0)
            max = build_symbolic_expr (expr_type, sym_max_op0,
                                       neg_max_op0, max);
          else if (sym_max_op1)
            max = build_symbolic_expr (expr_type, sym_max_op1,
                                       neg_max_op1 ^ minus_p, max);

esp. for the case of when minus_p causes the negation to happen.

Reply via email to