unsigned HOST_WIDE_INT nonoverlapping_component_refs_p_may_alias;
unsigned HOST_WIDE_INT nonoverlapping_component_refs_p_no_alias;
unsigned HOST_WIDE_INT nonoverlapping_component_refs_since_match_p_may_alias;
+ unsigned HOST_WIDE_INT nonoverlapping_component_refs_since_match_p_must_overlap;
unsigned HOST_WIDE_INT nonoverlapping_component_refs_since_match_p_no_alias;
} alias_stats;
+ alias_stats.nonoverlapping_component_refs_p_may_alias);
fprintf (s, " nonoverlapping_component_refs_since_match_p: "
HOST_WIDE_INT_PRINT_DEC" disambiguations, "
+ HOST_WIDE_INT_PRINT_DEC" must overlaps, "
HOST_WIDE_INT_PRINT_DEC" queries\n",
alias_stats.nonoverlapping_component_refs_since_match_p_no_alias,
+ alias_stats.nonoverlapping_component_refs_since_match_p_must_overlap,
alias_stats.nonoverlapping_component_refs_since_match_p_no_alias
- + alias_stats.nonoverlapping_component_refs_since_match_p_may_alias);
+ + alias_stats.nonoverlapping_component_refs_since_match_p_may_alias
+ + alias_stats.nonoverlapping_component_refs_since_match_p_must_overlap);
fprintf (s, " aliasing_component_refs_p: "
HOST_WIDE_INT_PRINT_DEC" disambiguations, "
HOST_WIDE_INT_PRINT_DEC" queries\n",
nonoverlapping_component_refs_since_match_p (tree match1, tree ref1,
tree match2, tree ref2)
{
+ /* Early return if there are no references to match, we do not need
+ to walk the access paths.
+
+ Do not consider this as may-alias for stats - it is more useful
+ to have information how many disambiguations happened provided that
+ the query was meaningful. */
+
+ if (match1 == ref1 || !handled_component_p (ref1)
+ || match2 == ref2 || !handled_component_p (ref2))
+ return -1;
+
auto_vec<tree, 16> component_refs1;
auto_vec<tree, 16> component_refs2;
if (component_refs1.is_empty ())
{
++alias_stats
- .nonoverlapping_component_refs_since_match_p_may_alias;
+ .nonoverlapping_component_refs_since_match_p_must_overlap;
return 0;
}
ref1 = component_refs1.pop ();
if (component_refs2.is_empty ())
{
++alias_stats
- .nonoverlapping_component_refs_since_match_p_may_alias;
+ .nonoverlapping_component_refs_since_match_p_must_overlap;
return 0;
}
ref2 = component_refs2.pop ();
|| DECL_BIT_FIELD_REPRESENTATIVE (field2) == field1)
{
++alias_stats
- .nonoverlapping_component_refs_since_match_p_may_alias;
+ .nonoverlapping_component_refs_since_match_p_must_overlap;
return 0;
}
/* Different fields of the same record type cannot overlap.
if (DECL_BIT_FIELD (field1) && DECL_BIT_FIELD (field2))
{
++alias_stats
- .nonoverlapping_component_refs_since_match_p_may_alias;
+ .nonoverlapping_component_refs_since_match_p_must_overlap;
return 0;
}
++alias_stats.nonoverlapping_component_refs_since_match_p_no_alias;
}
}
- ++alias_stats.nonoverlapping_component_refs_since_match_p_may_alias;
+ ++alias_stats.nonoverlapping_component_refs_since_match_p_must_overlap;
return 0;
}
static bool
nonoverlapping_component_refs_p (const_tree x, const_tree y)
{
+ /* Early return if we have nothing to do.
+
+ Do not consider this as may-alias for stats - it is more useful
+ to have information how many disambiguations happened provided that
+ the query was meaningful. */
if (!flag_strict_aliasing
|| !x || !y
|| !handled_component_p (x)
|| !handled_component_p (y))
- {
- ++alias_stats.nonoverlapping_component_refs_p_may_alias;
- return false;
- }
+ return false;
auto_vec<const_tree, 16> fieldsx;
while (handled_component_p (x))