diff options
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index c2a82ef..707e31c 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3563,12 +3563,11 @@ do_structure_copy (tree lhsop, tree rhsop) VEC_free (ce_s, heap, rhsc); } -/* Create a constraint ID = OP. */ +/* Create constraints ID = { rhsc }. */ static void -make_constraint_to (unsigned id, tree op) +make_constraints_to (unsigned id, VEC(ce_s, heap) *rhsc) { - VEC(ce_s, heap) *rhsc = NULL; struct constraint_expr *c; struct constraint_expr includes; unsigned int j; @@ -3577,9 +3576,18 @@ make_constraint_to (unsigned id, tree op) includes.offset = 0; includes.type = SCALAR; - get_constraint_for_rhs (op, &rhsc); FOR_EACH_VEC_ELT (ce_s, rhsc, j, c) process_constraint (new_constraint (includes, *c)); +} + +/* Create a constraint ID = OP. */ + +static void +make_constraint_to (unsigned id, tree op) +{ + VEC(ce_s, heap) *rhsc = NULL; + get_constraint_for_rhs (op, &rhsc); + make_constraints_to (id, rhsc); VEC_free (ce_s, heap, rhsc); } @@ -4334,8 +4342,7 @@ find_func_aliases (gimple origt) of global memory but not of escaped memory. */ if (flags & (ECF_CONST|ECF_NOVOPS)) { - if (gimple_call_lhs (t) - && could_have_pointers (gimple_call_lhs (t))) + if (gimple_call_lhs (t)) handle_const_call (t, &rhsc); } /* Pure functions can return addresses in and of memory @@ -4345,9 +4352,17 @@ find_func_aliases (gimple origt) handle_pure_call (t, &rhsc); else handle_rhs_call (t, &rhsc); - if (gimple_call_lhs (t) - && could_have_pointers (gimple_call_lhs (t))) - handle_lhs_call (t, gimple_call_lhs (t), flags, rhsc, fndecl); + if (gimple_call_lhs (t)) + { + if (could_have_pointers (gimple_call_lhs (t))) + handle_lhs_call (t, gimple_call_lhs (t), flags, rhsc, fndecl); + /* Similar to conversions a result that is not a pointer + is an escape point for any pointer the function might + return. */ + else if (flags & (ECF_CONST|ECF_PURE + |ECF_NOVOPS|ECF_LOOPING_CONST_OR_PURE)) + make_constraints_to (escaped_id, rhsc); + } VEC_free (ce_s, heap, rhsc); } else |