On Tue, Feb 15, 2022 at 10:46:21AM -0500, Andrew MacLeod wrote:
> Bootstraps on x86_64-pc-linux-gnu with no regressions. But I'm running it
> through again to be sure. OK for trunk, or want to wait for the next
> release?
I'd like to see it in GCC 12 because it is a fix for a P1 regression.
> +bool
> +gori_compute::condexpr_adjust (irange &r1, irange &r2, gimple *, tree cond,
> + tree op1, tree op2, fur_source &src)
> +{
> + int_range_max tmp, cond_true, cond_false;
> + tree ssa1 = gimple_range_ssa_p (op1);
> + tree ssa2 = gimple_range_ssa_p (op2);
> + if (!ssa1 && !ssa2)
> + return false;
> + if (!COMPARISON_CLASS_P (cond))
> + return false;
> + range_operator *hand = range_op_handler (TREE_CODE (cond), TREE_TYPE
> (op1));
Maybe I'm missing something, but I would expect calling range_op_handler
with the type of the comparison operands, i.e.
TREE_TYPE (TREE_OPERAND (cond, 0))
or so, rather than the type of lhs/op1/op2.
The comparison arguments could have a different type from lhs/op1/op2...
Otherwise LGTM, but my knowledge about ranger is very limited.
Jakub