On Tue, 7 Feb 2017, Jakub Jelinek wrote:
* tree-vrp.c (simplify_div_or_mod_using_ranges): If op1 is not constant, but SSA_NAME with a known integer range, use the minimum of that range instead of op1 to determine if modulo can be replaced with its first operand.
Would it make sense to use something like the operand_less_p helper so we would also handle an INTEGER_CST lhs?
unsigned f(unsigned x){ if(x<42)return 18; return 33%x; } -- Marc Glisse