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

--- Comment #7 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> ---
This is caused by missing to check a vr's "undefine_p".

In the pattern "(X + C) / N", 

    (if (exact_mod (c)
...
          && range_op_handler (PLUS_EXPR).overflow_free_p (vr0, vr1) 
...)
       (plus (op @0 @2) { wide_int_to_tree (type, plus_op1 (c)); })
       (if (TYPE_UNSIGNED (type) && c.sign_mask () < 0
            && exact_mod (-c)
            /* unsigned "X-(-C)" doesn't underflow.  */
            && wi::geu_p (vr0.lower_bound (), -c))

In the "(if (exact_mode (c)" part, the code "overflow_free_p (vr0, vr1)" checks
v0/vr are defined. 
But in the "else" part, "if (... && wi::geu_p (vr0.lower_bound (), -c)", vr0 is
not checked undefined_p.

Reply via email to