summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/tree-ssa-alias.c')
-rw-r--r--contrib/gcc/tree-ssa-alias.c97
1 files changed, 49 insertions, 48 deletions
diff --git a/contrib/gcc/tree-ssa-alias.c b/contrib/gcc/tree-ssa-alias.c
index c700733..d9232b0 100644
--- a/contrib/gcc/tree-ssa-alias.c
+++ b/contrib/gcc/tree-ssa-alias.c
@@ -1,5 +1,5 @@
/* Alias analysis for trees.
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -1961,28 +1961,29 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem_alias_set,
gcc_assert (TREE_CODE (mem) == SYMBOL_MEMORY_TAG);
- alias_stats.tbaa_queries++;
-
- /* If the alias sets don't conflict then MEM cannot alias VAR. */
- if (!alias_sets_conflict_p (mem_alias_set, var_alias_set))
+ if (!DECL_NO_TBAA_P (ptr))
{
- alias_stats.alias_noalias++;
- alias_stats.tbaa_resolved++;
- return false;
- }
+ alias_stats.tbaa_queries++;
- /* If var is a record or union type, ptr cannot point into var
- unless there is some operation explicit address operation in the
- program that can reference a field of the ptr's dereferenced
- type. This also assumes that the types of both var and ptr are
- contained within the compilation unit, and that there is no fancy
- addressing arithmetic associated with any of the types
- involved. */
+ /* If the alias sets don't conflict then MEM cannot alias VAR. */
+ if (!alias_sets_conflict_p (mem_alias_set, var_alias_set))
+ {
+ alias_stats.alias_noalias++;
+ alias_stats.tbaa_resolved++;
+ return false;
+ }
- if ((mem_alias_set != 0) && (var_alias_set != 0))
- {
- tree ptr_type = TREE_TYPE (ptr);
- tree var_type = TREE_TYPE (var);
+ /* If VAR is a record or union type, PTR cannot point into VAR
+ unless there is some explicit address operation in the
+ program that can reference a field of the type pointed-to by
+ PTR. This also assumes that the types of both VAR and PTR
+ are contained within the compilation unit, and that there is
+ no fancy addressing arithmetic associated with any of the
+ types involved. */
+ if (mem_alias_set != 0 && var_alias_set != 0)
+ {
+ tree ptr_type = TREE_TYPE (ptr);
+ tree var_type = TREE_TYPE (var);
/* The star count is -1 if the type at the end of the pointer_to
chain is not a record or union type. */
@@ -1991,41 +1992,41 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem_alias_set,
{
int ptr_star_count = 0;
- /* Ipa_type_escape_star_count_of_interesting_type is a little to
- restrictive for the pointer type, need to allow pointers to
- primitive types as long as those types cannot be pointers
- to everything. */
- while (POINTER_TYPE_P (ptr_type))
- /* Strip the *'s off. */
- {
- ptr_type = TREE_TYPE (ptr_type);
- ptr_star_count++;
- }
-
- /* There does not appear to be a better test to see if the
- pointer type was one of the pointer to everything
- types. */
+ /* ipa_type_escape_star_count_of_interesting_type is a
+ little too restrictive for the pointer type, need to
+ allow pointers to primitive types as long as those
+ types cannot be pointers to everything. */
+ while (POINTER_TYPE_P (ptr_type))
+ {
+ /* Strip the *s off. */
+ ptr_type = TREE_TYPE (ptr_type);
+ ptr_star_count++;
+ }
- if (ptr_star_count > 0)
- {
- alias_stats.structnoaddress_queries++;
- if (ipa_type_escape_field_does_not_clobber_p (var_type,
- TREE_TYPE (ptr)))
+ /* There does not appear to be a better test to see if
+ the pointer type was one of the pointer to everything
+ types. */
+ if (ptr_star_count > 0)
+ {
+ alias_stats.structnoaddress_queries++;
+ if (ipa_type_escape_field_does_not_clobber_p (var_type,
+ TREE_TYPE (ptr)))
+ {
+ alias_stats.structnoaddress_resolved++;
+ alias_stats.alias_noalias++;
+ return false;
+ }
+ }
+ else if (ptr_star_count == 0)
{
+ /* If PTR_TYPE was not really a pointer to type, it cannot
+ alias. */
+ alias_stats.structnoaddress_queries++;
alias_stats.structnoaddress_resolved++;
alias_stats.alias_noalias++;
return false;
}
}
- else if (ptr_star_count == 0)
- {
- /* If ptr_type was not really a pointer to type, it cannot
- alias. */
- alias_stats.structnoaddress_queries++;
- alias_stats.structnoaddress_resolved++;
- alias_stats.alias_noalias++;
- return false;
- }
}
}
OpenPOWER on IntegriCloud