diff options
author | Diego Novillo <dnovillo@redhat.com> | 2005-04-01 17:16:04 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@redhat.com> | 2005-04-01 17:16:04 +0000 |
commit | 2c1b41938630950e8699a2cbae3088b9c179f809 (patch) | |
tree | f93745f2390682fcf3269662fee7c5e14bf0d2d1 /gcc/tree-ssanames.c | |
parent | 7b560836d28c028988edc3c1ccc7348bbfc91ac8 (diff) |
Merge mainline->tcb as of 2005-03-29.tree-cleanup-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r-- | gcc/tree-ssanames.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 656bfac1948..df292d32150 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -228,22 +228,38 @@ duplicate_ssa_name (tree name, tree stmt) { tree new_name = make_ssa_name (SSA_NAME_VAR (name), stmt); struct ptr_info_def *old_ptr_info = SSA_NAME_PTR_INFO (name); + + if (old_ptr_info) + duplicate_ssa_name_ptr_info (new_name, old_ptr_info); + + return new_name; +} + + +/* Creates a duplicate of the ptr_info_def at PTR_INFO for use by + the ssa name NAME. */ + +void +duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info) +{ struct ptr_info_def *new_ptr_info; - if (!old_ptr_info) - return new_name; + gcc_assert (POINTER_TYPE_P (TREE_TYPE (name))); + gcc_assert (!SSA_NAME_PTR_INFO (name)); + + if (!ptr_info) + return; new_ptr_info = ggc_alloc (sizeof (struct ptr_info_def)); - *new_ptr_info = *old_ptr_info; + *new_ptr_info = *ptr_info; - if (old_ptr_info->pt_vars) + if (ptr_info->pt_vars) { new_ptr_info->pt_vars = BITMAP_GGC_ALLOC (); - bitmap_copy (new_ptr_info->pt_vars, old_ptr_info->pt_vars); + bitmap_copy (new_ptr_info->pt_vars, ptr_info->pt_vars); } - SSA_NAME_PTR_INFO (new_name) = new_ptr_info; - return new_name; + SSA_NAME_PTR_INFO (name) = new_ptr_info; } |