summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-03 08:43:45 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-03 08:43:45 +0000
commit83b34c62d37b8b2626d357878bc4cf1fe2020851 (patch)
tree12db18961c42def11ca08dfd5229612afd843c31 /gcc/alias.c
parent920e54ef4976f86f653c39104b54f82d7a38ff31 (diff)
downloadgcc-83b34c62d37b8b2626d357878bc4cf1fe2020851.tar.gz
* gimplify.c (find_single_pointer_decl_1): New static function.
(find_single_pointer_decl): New static function. (internal_get_tmp_var): For a formal variable, set restrict base information if appropriate. * alias.c (find_base_decl): If a VAR_DECL has a restrict base, return it. * tree.h (DECL_BASED_ON_RESTRICT_P): Define. (DECL_GET_RESTRICT_BASE): Define. (SET_DECL_RESTRICT_BASE): Define. (decl_restrict_base_lookup): Declare. (decl_restrict_base_insert): Declare. (struct tree_decl_with_vis): Add based_on_restrict_p field. * tree.c (restrict_base_for_decl): New static variable. (init_ttree): Initialize restrict_base_for_decl. (copy_node_stat): Copy restrict base information. (decl_restrict_base_lookup): New function. (decl_restrict_base_insert): New function. (print_restrict_base_statistics): New static function. (dump_tree_statistics): Call print_restrict_base_statistics. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 49f712e97e0..48060199092 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -395,9 +395,14 @@ find_base_decl (tree t)
if (t == 0 || t == error_mark_node || ! POINTER_TYPE_P (TREE_TYPE (t)))
return 0;
- /* If this is a declaration, return it. */
+ /* If this is a declaration, return it. If T is based on a restrict
+ qualified decl, return that decl. */
if (DECL_P (t))
- return 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