On Sat, Apr 6, 2013 at 2:48 PM, Jeff Law wrote:
>
> Given something like this:
...and the other one from earlier today. Nice finds! :-)
> + /* If we have a comparison of a SSA_NAME boolean against
> + a constant (which obviously must be [0..1]). See if the
"...be [0..1]), see if ..."
> + if (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI (innerop))
> + {
> + value_range_t *vr = get_value_range (innerop);
> +
I don't think the SSA_NAME_OCCURS_IN_ABNORMAL_PHI test is necessary,
get_value_range() will simply return a !VR_RANGE.
> + if (vr->type == VR_RANGE
> + && operand_equal_p (vr->min, integer_zero_node, 0)
> + && operand_equal_p (vr->max, integer_one_node, 0))
> + {
Better use range_int_cst_p(vr) followed by compare_tree_int instead of
operand_equal_p IMHO.
Print something to dump_file?
Ciao!
Steven