diff --git a/gcc/gimple-range-op.cc b/gcc/gimple-range-op.cc index d9dfdc56939..e4391f4a616 100644 --- a/gcc/gimple-range-op.cc +++ b/gcc/gimple-range-op.cc @@ -179,6 +179,8 @@ gimple_range_op_handler::gimple_range_op_handler (gimple *s) // statements. if (is_a (m_stmt)) maybe_builtin_call (); + else + maybe_non_standard (); } // Calculate what we can determine of the range of this unary @@ -764,6 +766,29 @@ public: } } op_cfn_parity; +// Set up a gimple_range_op_handler for any nonstandard function which can be +// supported via range-ops. + +void +gimple_range_op_handler::maybe_non_standard () +{ + if (gimple_code (m_stmt) == GIMPLE_ASSIGN) + switch (gimple_assign_rhs_code (m_stmt)) + { + case WIDEN_MULT_EXPR: + extern class range_operator &op_widen_mult_signed; + extern class range_operator &op_widen_mult_unsigned; + m_valid = true; + m_op1 = gimple_assign_rhs1 (m_stmt); + m_op2 = gimple_assign_rhs2 (m_stmt); + if (TYPE_SIGN (TREE_TYPE (m_op1)) == SIGNED) + m_int = &op_widen_mult_signed; + else + m_int = &op_widen_mult_unsigned; + default: + break; + } +} // Set up a gimple_range_op_handler for any built in function which can be // supported via range-ops. diff --git a/gcc/gimple-range-op.h b/gcc/gimple-range-op.h index 743b858126e..1bf63c5ce6f 100644 --- a/gcc/gimple-range-op.h +++ b/gcc/gimple-range-op.h @@ -41,6 +41,7 @@ public: relation_trio = TRIO_VARYING); private: void maybe_builtin_call (); + void maybe_non_standard (); gimple *m_stmt; tree m_op1, m_op2; };