diff options
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 4bd0b4b..5d9d8cf 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -106,43 +106,42 @@ static GTY ((cache)) hash_table<ipa_bit_ggc_hash_traits> *ipa_bits_hash_table; /* Traits for a hash table for reusing value_ranges used for IPA. Note that the equiv bitmap is not hashed and is expected to be NULL. */ -struct ipa_vr_ggc_hash_traits : public ggc_cache_remove <value_range *> +struct ipa_vr_ggc_hash_traits : public ggc_cache_remove <value_range_base *> { - typedef value_range *value_type; - typedef value_range *compare_type; + typedef value_range_base *value_type; + typedef value_range_base *compare_type; static hashval_t - hash (const value_range *p) + hash (const value_range_base *p) { - gcc_checking_assert (!p->equiv ()); inchash::hash hstate (p->kind ()); inchash::add_expr (p->min (), hstate); inchash::add_expr (p->max (), hstate); return hstate.end (); } static bool - equal (const value_range *a, const value_range *b) + equal (const value_range_base *a, const value_range_base *b) { return a->ignore_equivs_equal_p (*b); } static void - mark_empty (value_range *&p) + mark_empty (value_range_base *&p) { p = NULL; } static bool - is_empty (const value_range *p) + is_empty (const value_range_base *p) { return p == NULL; } static bool - is_deleted (const value_range *p) + is_deleted (const value_range_base *p) { - return p == reinterpret_cast<const value_range *> (1); + return p == reinterpret_cast<const value_range_base *> (1); } static void - mark_deleted (value_range *&p) + mark_deleted (value_range_base *&p) { - p = reinterpret_cast<value_range *> (1); + p = reinterpret_cast<value_range_base *> (1); } }; @@ -1770,14 +1769,14 @@ ipa_set_jfunc_bits (ipa_jump_func *jf, const widest_int &value, /* Return a pointer to a value_range just like *TMP, but either find it in ipa_vr_hash_table or allocate it in GC memory. TMP->equiv must be NULL. */ -static value_range * -ipa_get_value_range (value_range *tmp) +static value_range_base * +ipa_get_value_range (value_range_base *tmp) { - value_range **slot = ipa_vr_hash_table->find_slot (tmp, INSERT); + value_range_base **slot = ipa_vr_hash_table->find_slot (tmp, INSERT); if (*slot) return *slot; - value_range *vr = ggc_alloc<value_range> (); + value_range_base *vr = ggc_alloc<value_range_base> (); *vr = *tmp; *slot = vr; @@ -1788,10 +1787,10 @@ ipa_get_value_range (value_range *tmp) equiv set. Use hash table in order to avoid creating multiple same copies of value_ranges. */ -static value_range * +static value_range_base * ipa_get_value_range (enum value_range_kind type, tree min, tree max) { - value_range tmp (type, min, max); + value_range_base tmp (type, min, max); return ipa_get_value_range (&tmp); } @@ -1810,7 +1809,7 @@ ipa_set_jfunc_vr (ipa_jump_func *jf, enum value_range_kind type, copy from ipa_vr_hash_table or allocate a new on in GC memory. */ static void -ipa_set_jfunc_vr (ipa_jump_func *jf, value_range *tmp) +ipa_set_jfunc_vr (ipa_jump_func *jf, value_range_base *tmp) { jf->m_vr = ipa_get_value_range (tmp); } @@ -1886,6 +1885,8 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, && (type = get_range_info (arg, &min, &max)) && (type == VR_RANGE || type == VR_ANTI_RANGE)) { + /* ??? We'd want to use value_range_base here but the + VRP workers need to be adjusted first. */ value_range resvr; value_range tmpvr (type, wide_int_to_tree (TREE_TYPE (arg), min), |