diff options
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index f22605626d3..77ff17a6962 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -197,8 +197,7 @@ keep the set of called functions for indirect calls. And probably more. */ - -static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) +static GTY ((if_marked ("tree_map_marked_p"), param_is (struct heapvar_map))) htab_t heapvar_for_stmt; static bool use_field_sensitive = true; @@ -379,7 +378,7 @@ heapvar_insert (tree from, unsigned HOST_WIDE_INT offset, tree to) struct heapvar_map *h; void **loc; - h = GGC_NEW (struct heapvar_map); + h = ggc_alloc_heapvar_map (); h->map.base.from = from; h->offset = offset; h->map.hash = heapvar_map_hash (h); @@ -3108,7 +3107,8 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results, &0->a.b */ forzero = t; while (handled_component_p (forzero) - || INDIRECT_REF_P (forzero)) + || INDIRECT_REF_P (forzero) + || TREE_CODE (forzero) == MEM_REF) forzero = TREE_OPERAND (forzero, 0); if (CONSTANT_CLASS_P (forzero) && integer_zerop (forzero)) @@ -3335,9 +3335,10 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p) { switch (TREE_CODE (t)) { - case INDIRECT_REF: + case MEM_REF: { - get_constraint_for_1 (TREE_OPERAND (t, 0), results, address_p); + get_constraint_for_ptr_offset (TREE_OPERAND (t, 0), + TREE_OPERAND (t, 1), results); do_deref (results); return; } @@ -4573,7 +4574,11 @@ find_func_clobbers (gimple origt) tem = TREE_OPERAND (tem, 0); if ((DECL_P (tem) && !auto_var_in_fn_p (tem, cfun->decl)) - || INDIRECT_REF_P (tem)) + || INDIRECT_REF_P (tem) + || (TREE_CODE (tem) == MEM_REF + && !(TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR + && auto_var_in_fn_p + (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), cfun->decl)))) { struct constraint_expr lhsc, *rhsp; unsigned i; @@ -4597,7 +4602,11 @@ find_func_clobbers (gimple origt) tem = TREE_OPERAND (tem, 0); if ((DECL_P (tem) && !auto_var_in_fn_p (tem, cfun->decl)) - || INDIRECT_REF_P (tem)) + || INDIRECT_REF_P (tem) + || (TREE_CODE (tem) == MEM_REF + && !(TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR + && auto_var_in_fn_p + (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), cfun->decl)))) { struct constraint_expr lhs, *rhsp; unsigned i; |