diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-02 13:25:23 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-02 13:25:23 +0000 |
commit | e1c894dd585490f66a453b1e81366daba0db607c (patch) | |
tree | f37be14bcfe974e0f88b36294c0390a85e6fe224 /gcc/tree-ssa-loop-ivopts.c | |
parent | 7b132fabb725760385c89d256014db4d7cae81ac (diff) | |
download | gcc-e1c894dd585490f66a453b1e81366daba0db607c.tar.gz |
2010-07-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (pt_solution_set_var): New function.
* tree-ssa-alias.h (pt_solution_set_var): Declare.
* tree-ssa-loop-ivopts.c (copy_ref_info): Also copy or create
points-to information.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161716 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 46356588c94..02677fa9049 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5549,6 +5549,27 @@ copy_ref_info (tree new_ref, tree old_ref) TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref); TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref); TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref); + /* We can transfer points-to information from an old pointer + or decl base to the new one. */ + if (TMR_BASE (new_ref) + && TREE_CODE (TMR_BASE (new_ref)) == SSA_NAME + && POINTER_TYPE_P (TREE_TYPE (TMR_BASE (new_ref))) + && !SSA_NAME_PTR_INFO (TMR_BASE (new_ref))) + { + tree base = get_base_address (old_ref); + if ((INDIRECT_REF_P (base) + || TREE_CODE (base) == MEM_REF) + && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME) + duplicate_ssa_name_ptr_info + (TMR_BASE (new_ref), SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0))); + else if (TREE_CODE (base) == VAR_DECL + || TREE_CODE (base) == PARM_DECL + || TREE_CODE (base) == RESULT_DECL) + { + struct ptr_info_def *pi = get_ptr_info (TMR_BASE (new_ref)); + pt_solution_set_var (&pi->pt, base); + } + } } } |