diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-16 14:12:44 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-16 14:12:44 +0000 |
commit | e8146f09dd5125421f06a96bdb1c57e45920f946 (patch) | |
tree | 7cde33eea870313f90b60f30132fd44837a55153 /gcc/tree-ssa-alias.c | |
parent | 60a132a95ad5c01ef79b1233f4058d44cd058e87 (diff) | |
download | gcc-e8146f09dd5125421f06a96bdb1c57e45920f946.tar.gz |
2009-06-16 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (is_escape_site): Remove.
* tree-ssa-alias.h (enum escape_type): Remove.
(is_escape_site): Likewise.
* tree-ssa-structalias.c (find_func_aliases): Handle escapes
via casts and asms without deferring to is_escape_site.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 0b8c2515fee..6cbec5de2bf 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -232,82 +232,6 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2) return pt_solutions_intersect (&pi1->pt, &pi2->pt); } -/* Return true if STMT is an "escape" site from the current function. Escape - sites those statements which might expose the address of a variable - outside the current function. STMT is an escape site iff: - - 1- STMT is a function call, or - 2- STMT is an __asm__ expression, or - 3- STMT is an assignment to a non-local variable, or - 4- STMT is a return statement. - - Return the type of escape site found, if we found one, or NO_ESCAPE - if none. */ - -enum escape_type -is_escape_site (gimple stmt) -{ - if (is_gimple_call (stmt)) - { - if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST)) - return ESCAPE_TO_PURE_CONST; - - return ESCAPE_TO_CALL; - } - else if (gimple_code (stmt) == GIMPLE_ASM) - return ESCAPE_TO_ASM; - else if (is_gimple_assign (stmt)) - { - tree lhs = gimple_assign_lhs (stmt); - - /* Get to the base of _REF nodes. */ - if (TREE_CODE (lhs) != SSA_NAME) - lhs = get_base_address (lhs); - - /* If we couldn't recognize the LHS of the assignment, assume that it - is a non-local store. */ - if (lhs == NULL_TREE) - return ESCAPE_UNKNOWN; - - if (gimple_assign_cast_p (stmt)) - { - tree from = TREE_TYPE (gimple_assign_rhs1 (stmt)); - tree to = TREE_TYPE (lhs); - - /* If the RHS is a conversion between a pointer and an integer, the - pointer escapes since we can't track the integer. */ - if (POINTER_TYPE_P (from) && !POINTER_TYPE_P (to)) - return ESCAPE_BAD_CAST; - } - - /* If the LHS is an SSA name, it can't possibly represent a non-local - memory store. */ - if (TREE_CODE (lhs) == SSA_NAME) - return NO_ESCAPE; - - /* If the LHS is a non-global decl, it isn't a non-local memory store. - If the LHS escapes, the RHS escape is dealt with in the PTA solver. */ - if (DECL_P (lhs) - && !is_global_var (lhs)) - return NO_ESCAPE; - - /* FIXME: LHS is not an SSA_NAME. Even if it's an assignment to a - local variables we cannot be sure if it will escape, because we - don't have information about objects not in SSA form. Need to - implement something along the lines of - - J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. - Midkiff, ``Escape analysis for java,'' in Proceedings of the - Conference on Object-Oriented Programming Systems, Languages, and - Applications (OOPSLA), pp. 1-19, 1999. */ - return ESCAPE_STORED_IN_GLOBAL; - } - else if (gimple_code (stmt) == GIMPLE_RETURN) - return ESCAPE_TO_RETURN; - - return NO_ESCAPE; -} - /* Dump alias information on FILE. */ |