diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-29 12:20:39 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-29 12:20:39 +0000 |
commit | 8115f0afdaff380da01d555b0584cd0fceb789b8 (patch) | |
tree | e708803ab158cd132fb494655ffed7aec0ca820d /gcc/alias.c | |
parent | a000e0d1225afc60305711a6dd3a5bd9ebc4ddd6 (diff) | |
download | gcc-8115f0afdaff380da01d555b0584cd0fceb789b8.tar.gz |
2009-06-29 Richard Guenther <rguenther@suse.de>
PR middle-end/38212
* alias.c (find_base_decl): Remove.
(get_deref_alias_set_1): Remove restrict handling.
* c-common.c (c_apply_type_quals_to_decl): Do not set
DECL_POINTER_ALIAS_SET.
* gimplify.c (find_single_pointer_decl_1): Remove.
(find_single_pointer_decl): Likewise.
(internal_get_tmp_var): Remove restrict handling.
(gimple_regimplify_operands): Likewise.
* omp-low.c (expand_omp_atomic_pipeline): Do not set
DECL_POINTER_ALIAS_SET. Use ref-all pointers.
* print-tree.c (print_node): Do not print DECL_POINTER_ALIAS_SET.
* tree.c (restrict_base_for_decl): Remove.
(init_ttree): Do not allocate it.
(make_node_stat): Do not set DECL_POINTER_ALIAS_SET. Set
LABEL_DECL_UID for label decls.
(copy_node_stat): Do not copy restrict information.
(decl_restrict_base_lookup): Remove.
(decl_restrict_base_insert): Likewise.
(print_restrict_base_statistics): Likewise.
(dump_tree_statistics): Do not call print_restrict_base_statistics.
* tree.h (DECL_POINTER_ALIAS_SET): Remove.
(DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise.
(struct tree_decl_common): Rename pointer_alias_set to label_decl_uid.
(LABEL_DECL_UID): Adjust.
(DECL_BASED_ON_RESTRICT_P): Remove.
(DECL_GET_RESTRICT_BASE): Likewise.
(SET_DECL_RESTRICT_BASE): Likewise.
(struct tree_decl_with_vis): Remove based_on_restrict_p flag.
* config/i386/i386.c (ix86_gimplify_va_arg): Use ref-all pointers
instead of DECL_POINTER_ALIAS_SET.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
* config/s390/s390.c (s390_gimplify_va_arg): Likewise.
* config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise.
* gcc.c-torture/execute/pr38212.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149047 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 103 |
1 files changed, 2 insertions, 101 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 7d9faf2c920..248600179f8 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -155,7 +155,6 @@ static int base_alias_check (rtx, rtx, enum machine_mode, static rtx find_base_value (rtx); static int mems_in_disjoint_alias_sets_p (const_rtx, const_rtx); static int insert_subset_children (splay_tree_node, void*); -static tree find_base_decl (tree); static alias_set_entry get_alias_set_entry (alias_set_type); static const_rtx fixed_scalar_and_varying_struct_p (const_rtx, const_rtx, rtx, rtx, bool (*) (const_rtx, bool)); @@ -422,57 +421,6 @@ objects_must_conflict_p (tree t1, tree t2) return alias_sets_must_conflict_p (set1, set2); } -/* T is an expression with pointer type. Find the DECL on which this - expression is based. (For example, in `a[i]' this would be `a'.) - If there is no such DECL, or a unique decl cannot be determined, - NULL_TREE is returned. */ - -static tree -find_base_decl (tree t) -{ - tree d0, d1; - - if (t == 0 || t == error_mark_node || ! POINTER_TYPE_P (TREE_TYPE (t))) - return 0; - - if (TREE_CODE (t) == SSA_NAME) - t = SSA_NAME_VAR (t); - - /* If this is a declaration, return it. If T is based on a restrict - qualified decl, return that decl. */ - if (DECL_P (t)) - { - if (TREE_CODE (t) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (t)) - t = DECL_GET_RESTRICT_BASE (t); - return t; - } - - /* Handle general expressions. It would be nice to deal with - COMPONENT_REFs here. If we could tell that `a' and `b' were the - same, then `a->f' and `b->f' are also the same. */ - switch (TREE_CODE_CLASS (TREE_CODE (t))) - { - case tcc_unary: - return find_base_decl (TREE_OPERAND (t, 0)); - - case tcc_binary: - /* Return 0 if found in neither or both are the same. */ - d0 = find_base_decl (TREE_OPERAND (t, 0)); - d1 = find_base_decl (TREE_OPERAND (t, 1)); - if (d0 == d1) - return d0; - else if (d0 == 0) - return d1; - else if (d1 == 0) - return d0; - else - return 0; - - default: - return 0; - } -} - /* Return true if all nested component references handled by get_inner_reference in T are such that we should use the alias set provided by the object at the heart of T. @@ -532,56 +480,9 @@ get_deref_alias_set_1 (tree t) if (!flag_strict_aliasing) return 0; + /* All we care about is the type. */ if (! TYPE_P (t)) - { - tree decl = find_base_decl (t); - - if (decl && DECL_POINTER_ALIAS_SET_KNOWN_P (decl)) - { - /* If we haven't computed the actual alias set, do it now. */ - if (DECL_POINTER_ALIAS_SET (decl) == -2) - { - tree pointed_to_type = TREE_TYPE (TREE_TYPE (decl)); - - /* No two restricted pointers can point at the same thing. - However, a restricted pointer can point at the same thing - as an unrestricted pointer, if that unrestricted pointer - is based on the restricted pointer. So, we make the - alias set for the restricted pointer a subset of the - alias set for the type pointed to by the type of the - decl. */ - alias_set_type pointed_to_alias_set - = get_alias_set (pointed_to_type); - - if (pointed_to_alias_set == 0) - /* It's not legal to make a subset of alias set zero. */ - DECL_POINTER_ALIAS_SET (decl) = 0; - else if (AGGREGATE_TYPE_P (pointed_to_type)) - /* For an aggregate, we must treat the restricted - pointer the same as an ordinary pointer. If we - were to make the type pointed to by the - restricted pointer a subset of the pointed-to - type, then we would believe that other subsets - of the pointed-to type (such as fields of that - type) do not conflict with the type pointed to - by the restricted pointer. */ - DECL_POINTER_ALIAS_SET (decl) - = pointed_to_alias_set; - else - { - DECL_POINTER_ALIAS_SET (decl) = new_alias_set (); - record_alias_subset (pointed_to_alias_set, - DECL_POINTER_ALIAS_SET (decl)); - } - } - - /* We use the alias set indicated in the declaration. */ - return DECL_POINTER_ALIAS_SET (decl); - } - - /* Now all we care about is the type. */ - t = TREE_TYPE (t); - } + t = TREE_TYPE (t); /* If we have an INDIRECT_REF via a void pointer, we don't know anything about what that might alias. Likewise if the |