Re: [PATCH] Fix division-by-unsigned optimization in VRP (PR tree-optimization/68431)

2015-11-19 Thread Richard Biener
On November 19, 2015 3:57:03 PM GMT+01:00, Marek Polacek wrote: >This fixes a failure to optimize division by an unsigned. The comment >before >the condition I'm fixing says "When vr0.max < 0, vr1.min != 0 and ..." >but >"&& !compare_values (vr1.min, zero)" actually ensures that vr1.min is >zero

[PATCH] Fix division-by-unsigned optimization in VRP (PR tree-optimization/68431)

2015-11-19 Thread Marek Polacek
This fixes a failure to optimize division by an unsigned. The comment before the condition I'm fixing says "When vr0.max < 0, vr1.min != 0 and ..." but "&& !compare_values (vr1.min, zero)" actually ensures that vr1.min is zero. (Indeed, the following int_const_binop would attemp to divide by zero