@@ -1644,7 +1644,7 @@ ipa_context_from_jfunc (ipa_node_params *info, cgraph_edge *cs, int csidx,
DST_TYPE on value range in SRC_VR and store it to DST_VR. Return true if
the result is a range that is not VARYING nor UNDEFINED. */
-static bool
+bool
ipa_vr_operation_and_type_effects (vrange &dst_vr,
const vrange &src_vr,
enum tree_code operation,
@@ -1670,7 +1670,7 @@ ipa_vr_operation_and_type_effects (vrange &dst_vr,
/* Same as above, but the SRC_VR argument is an IPA_VR which must
first be extracted onto a vrange. */
-static bool
+bool
ipa_vr_operation_and_type_effects (vrange &dst_vr,
const ipa_vr &src_vr,
enum tree_code operation,
@@ -299,4 +299,17 @@ ipa_vr_supported_type_p (tree type)
return irange::supports_p (type) || prange::supports_p (type);
}
+class ipa_vr;
+
+bool ipa_vr_operation_and_type_effects (vrange &dst_vr,
+ const vrange &src_vr,
+ enum tree_code operation,
+ tree dst_type, tree src_type);
+bool ipa_vr_operation_and_type_effects (vrange &dst_vr,
+ const ipa_vr &src_vr,
+ enum tree_code operation,
+ tree dst_type, tree src_type);
+
+
+
#endif /* IPA_CP_H */
@@ -3486,6 +3486,24 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs,
gcc_unreachable ();
}
+ if (src->m_vr && src->m_vr->known_p ())
+ {
+ value_range svr (src->m_vr->type ());
+ if (!dst->m_vr || !dst->m_vr->known_p ())
+ ipa_set_jfunc_vr (dst, *src->m_vr);
+ else if (ipa_vr_operation_and_type_effects (svr, *src->m_vr,
+ NOP_EXPR,
+ dst->m_vr->type (),
+ src->m_vr->type ()))
+ {
+ value_range dvr;
+ dst->m_vr->get_vrange (dvr);
+ dvr.intersect (svr);
+ if (!dvr.undefined_p ())
+ ipa_set_jfunc_vr (dst, dvr);
+ }
+ }
+
if (src->agg.items
&& (dst_agg_p || !src->agg.by_ref))
{