-/* Given a conditional predicate COND, try to determine if COND yields
- true or false based on the value ranges of its operands. Return
- BOOLEAN_TRUE_NODE if the conditional always evaluates to true,
- BOOLEAN_FALSE_NODE if the conditional always evaluates to false, and,
- NULL if the conditional cannot be evaluated at compile time.
-
- If USE_EQUIV_P is true, the ranges of all the names equivalent with
- the operands in COND are used when trying to compute its value.
- This is only used during final substitution. During propagation,
- we only check the range of each variable and not its equivalents.
-
- Set *STRICT_OVERFLOW_P to indicate whether we relied on an overflow
- infinity to produce the result. */
-
-static tree
-vrp_evaluate_conditional_warnv (tree cond, bool use_equiv_p,
- bool *strict_overflow_p)
-{
- gcc_assert (TREE_CODE (cond) == SSA_NAME
- || TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison);
-
- if (TREE_CODE (cond) == SSA_NAME)
- {
- value_range_t *vr;
- tree retval;
-
- if (use_equiv_p)
- retval = compare_name_with_value (NE_EXPR, cond, boolean_false_node,
- strict_overflow_p);
- else
- {
- value_range_t *vr = get_value_range (cond);
- retval = compare_range_with_value (NE_EXPR, vr, boolean_false_node,
- strict_overflow_p);
- }
-
- /* If COND has a known boolean range, return it. */
- if (retval)
- return retval;
-
- /* Otherwise, if COND has a symbolic range of exactly one value,
- return it. */
- vr = get_value_range (cond);
- if (vr->type == VR_RANGE && vr->min == vr->max)
- return vr->min;
- }
- else
- return vrp_evaluate_conditional_warnv_with_ops (TREE_CODE (cond),
- TREE_OPERAND (cond, 0),
- TREE_OPERAND (cond, 1),
- use_equiv_p,
- strict_overflow_p);
-
- /* Anything else cannot be computed statically. */
- return NULL_TREE;
-}
-
-/* Given COND within STMT, try to simplify it based on value range