summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 18:53:43 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 18:53:43 +0000
commit0b3bf4d669bd95d4597b9c25b552e3610acff8df (patch)
tree84f496a9d6b5b6bc4fe24fd19e64d6e7e6d43e4a /gcc/tree-ssa-alias.c
parent13ddbb77a5444f033b4246a84d162eb18f9e1ebb (diff)
downloadgcc-0b3bf4d669bd95d4597b9c25b552e3610acff8df.tar.gz
2008-06-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36400 PR tree-optimization/36373 PR tree-optimization/36344 * tree-ssa-structalias.c (var_escaped, escaped_tree, escaped_id, var_nonlocal, nonlocal_tree, nonlocal_id): New globals (update_alias_info): Remove call clobbering code. (make_constraint_to): New helper function. (make_escape_constraint): Likewise. (handle_rhs_call): Use it on all pointer containing arguments. Also mark the static chain escaped. (handle_lhs_call): Make constraints from NONLOCAL and ESCAPED instead of ANYTHING. (make_constraint_from): New helper split out from ... (make_constraint_from_anything): ... here. (find_func_aliases): Add constraints for escape sites. (intra_create_variable_infos): Make constraints from NONLOCAL for parameters. (find_what_p_points_to): Interpret NONLOCAL and ESCAPED the same as ANYTHING. (clobber_what_p_points_to): Remove. (clobber_what_escaped): New function. (init_base_vars): Init NONLOCAL and ESCAPED. (do_sd_constraint): Do not propagate the solution from ESCAPED but use ESCAPED as a placeholder. (solve_graph): Likewise. * tree-flow.h (clobber_what_p_points_to): Remove. (clobber_what_escaped): Declare. * tree-ssa-alias.c (set_initial_properties): Call it. Remove code clobbering escaped pointers. * gcc.dg/torture/pr36373-1.c: New testcase. * gcc.dg/torture/pr36373-2.c: Likewise. * gcc.dg/torture/pr36373-3.c: Likewise. * gcc.dg/torture/pr36373-4.c: Likewise. * gcc.dg/torture/pr36373-5.c: Likewise. * gcc.dg/torture/pr36373-6.c: Likewise. * gcc.dg/torture/pr36373-7.c: Likewise. * gcc.dg/torture/pr36373-8.c: Likewise. * gcc.dg/torture/pr36373-9.c: Likewise. * gcc.dg/torture/pr36373-10.c: Likewise. * gcc.dg/torture/pr36400.c: Likewise. * gcc.c-torture/execute/pta-field-1.c: Likewise. * gcc.c-torture/execute/pta-field-2.c: Likewise. * gcc.dg/tree-ssa/loadpre8.c: Remove XFAIL. * gcc.dg/tree-ssa/pr24287.c: XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137197 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 748ff31684e..7c24739e407 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -537,6 +537,12 @@ set_initial_properties (struct alias_info *ai)
}
}
+ if (!clobber_what_escaped ())
+ {
+ any_pt_anything = true;
+ pt_anything_mask |= ESCAPE_TO_CALL;
+ }
+
for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++)
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
@@ -557,18 +563,6 @@ set_initial_properties (struct alias_info *ai)
if (tag)
mark_call_clobbered (tag, pi->escape_mask);
-
- /* Defer to points-to analysis if possible, otherwise
- clobber all addressable variables. Parameters cannot
- point to local memory though.
- ??? Properly tracking which pointers point to non-local
- memory only would make a big difference here. */
- if (!clobber_what_p_points_to (ptr)
- && !(pi->escape_mask & ESCAPE_IS_PARM))
- {
- any_pt_anything = true;
- pt_anything_mask |= pi->escape_mask;
- }
}
/* If the name tag is call clobbered, so is the symbol tag
@@ -2906,6 +2900,12 @@ is_escape_site (tree stmt)
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