aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c82
1 files changed, 39 insertions, 43 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 4969edc..688b068 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -826,7 +826,7 @@ constraint_expr_less (struct constraint_expr a, struct constraint_expr b)
arbitrary, but consistent, in order to give them an ordering. */
static bool
-constraint_less (const constraint_t a, const constraint_t b)
+constraint_less (const constraint_t &a, const constraint_t &b)
{
if (constraint_expr_less (a->lhs, b->lhs))
return true;
@@ -2793,12 +2793,12 @@ get_constraint_for_ssa_var (tree t, VEC(ce_s, heap) **results, bool address_p)
for (; vi; vi = vi->next)
{
cexpr.var = vi->id;
- VEC_safe_push (ce_s, heap, *results, &cexpr);
+ VEC_safe_push (ce_s, heap, *results, cexpr);
}
return;
}
- VEC_safe_push (ce_s, heap, *results, &cexpr);
+ VEC_safe_push (ce_s, heap, *results, cexpr);
}
/* Process constraint T, performing various simplifications and then
@@ -2945,7 +2945,7 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
c2.type = ADDRESSOF;
c2.offset = 0;
if (c2.var != c.var)
- VEC_safe_push (ce_s, heap, *results, &c2);
+ VEC_safe_push (ce_s, heap, *results, c2);
temp = temp->next;
}
while (temp);
@@ -2980,7 +2980,7 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
c2.var = temp->next->id;
c2.type = ADDRESSOF;
c2.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &c2);
+ VEC_safe_push (ce_s, heap, *results, c2);
}
c.var = temp->id;
c.offset = 0;
@@ -3024,7 +3024,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
temp.offset = 0;
temp.var = integer_id;
temp.type = SCALAR;
- VEC_safe_push (ce_s, heap, *results, &temp);
+ VEC_safe_push (ce_s, heap, *results, temp);
return;
}
@@ -3046,7 +3046,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
temp.offset = 0;
temp.var = anything_id;
temp.type = ADDRESSOF;
- VEC_safe_push (ce_s, heap, *results, &temp);
+ VEC_safe_push (ce_s, heap, *results, temp);
return;
}
}
@@ -3087,7 +3087,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
bitpos, bitmaxsize))
{
cexpr.var = curr->id;
- VEC_safe_push (ce_s, heap, *results, &cexpr);
+ VEC_safe_push (ce_s, heap, *results, cexpr);
if (address_p)
break;
}
@@ -3102,7 +3102,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
while (curr->next != NULL)
curr = curr->next;
cexpr.var = curr->id;
- VEC_safe_push (ce_s, heap, *results, &cexpr);
+ VEC_safe_push (ce_s, heap, *results, cexpr);
}
else if (VEC_length (ce_s, *results) == 0)
/* Assert that we found *some* field there. The user couldn't be
@@ -3115,7 +3115,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
cexpr.type = SCALAR;
cexpr.var = anything_id;
cexpr.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &cexpr);
+ VEC_safe_push (ce_s, heap, *results, cexpr);
}
}
else if (bitmaxsize == 0)
@@ -3239,7 +3239,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
temp.var = nonlocal_id;
temp.type = ADDRESSOF;
temp.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &temp);
+ VEC_safe_push (ce_s, heap, *results, temp);
return;
}
@@ -3249,7 +3249,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
temp.var = readonly_id;
temp.type = SCALAR;
temp.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &temp);
+ VEC_safe_push (ce_s, heap, *results, temp);
return;
}
@@ -3310,7 +3310,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
if (curr->offset - vi->offset < size)
{
cs.var = curr->id;
- VEC_safe_push (ce_s, heap, *results, &cs);
+ VEC_safe_push (ce_s, heap, *results, cs);
}
else
break;
@@ -3352,7 +3352,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
unsigned j;
get_constraint_for_1 (val, &tmp, address_p, lhs_p);
FOR_EACH_VEC_ELT (ce_s, tmp, j, rhsp)
- VEC_safe_push (ce_s, heap, *results, rhsp);
+ VEC_safe_push (ce_s, heap, *results, *rhsp);
VEC_truncate (ce_s, tmp, 0);
}
VEC_free (ce_s, heap, tmp);
@@ -3376,7 +3376,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
temp.type = ADDRESSOF;
temp.var = nonlocal_id;
temp.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &temp);
+ VEC_safe_push (ce_s, heap, *results, temp);
return;
}
default:;
@@ -3386,7 +3386,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
temp.type = ADDRESSOF;
temp.var = anything_id;
temp.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &temp);
+ VEC_safe_push (ce_s, heap, *results, temp);
}
/* Given a gimple tree T, return the constraint expression vector for it. */
@@ -3793,7 +3793,7 @@ handle_rhs_call (gimple stmt, VEC(ce_s, heap) **results)
rhsc.var = get_call_use_vi (stmt)->id;
rhsc.offset = 0;
rhsc.type = SCALAR;
- VEC_safe_push (ce_s, heap, *results, &rhsc);
+ VEC_safe_push (ce_s, heap, *results, rhsc);
}
/* The static chain escapes as well. */
@@ -3820,7 +3820,7 @@ handle_rhs_call (gimple stmt, VEC(ce_s, heap) **results)
rhsc.var = nonlocal_id;
rhsc.offset = 0;
rhsc.type = SCALAR;
- VEC_safe_push (ce_s, heap, *results, &rhsc);
+ VEC_safe_push (ce_s, heap, *results, rhsc);
}
/* For non-IPA mode, generate constraints necessary for a call
@@ -3845,7 +3845,7 @@ handle_lhs_call (gimple stmt, tree lhs, int flags, VEC(ce_s, heap) *rhsc,
tmpc.var = escaped_id;
tmpc.offset = 0;
tmpc.type = SCALAR;
- VEC_safe_push (ce_s, heap, lhsc, &tmpc);
+ VEC_safe_push (ce_s, heap, lhsc, tmpc);
}
/* If the call returns an argument unmodified override the rhs
@@ -3880,7 +3880,7 @@ handle_lhs_call (gimple stmt, tree lhs, int flags, VEC(ce_s, heap) *rhsc,
tmpc.var = vi->id;
tmpc.offset = 0;
tmpc.type = ADDRESSOF;
- VEC_safe_push (ce_s, heap, rhsc, &tmpc);
+ VEC_safe_push (ce_s, heap, rhsc, tmpc);
process_all_all_constraints (lhsc, rhsc);
VEC_free (ce_s, heap, rhsc);
}
@@ -3909,7 +3909,7 @@ handle_const_call (gimple stmt, VEC(ce_s, heap) **results)
rhsc.var = uses->id;
rhsc.offset = 0;
rhsc.type = SCALAR;
- VEC_safe_push (ce_s, heap, *results, &rhsc);
+ VEC_safe_push (ce_s, heap, *results, rhsc);
}
/* May return arguments. */
@@ -3921,7 +3921,7 @@ handle_const_call (gimple stmt, VEC(ce_s, heap) **results)
struct constraint_expr *argp;
get_constraint_for_rhs (arg, &argc);
FOR_EACH_VEC_ELT (ce_s, argc, i, argp)
- VEC_safe_push (ce_s, heap, *results, argp);
+ VEC_safe_push (ce_s, heap, *results, *argp);
VEC_free(ce_s, heap, argc);
}
@@ -3929,7 +3929,7 @@ handle_const_call (gimple stmt, VEC(ce_s, heap) **results)
rhsc.var = nonlocal_id;
rhsc.offset = 0;
rhsc.type = ADDRESSOF;
- VEC_safe_push (ce_s, heap, *results, &rhsc);
+ VEC_safe_push (ce_s, heap, *results, rhsc);
}
/* For non-IPA mode, generate constraints necessary for a call to a
@@ -3971,12 +3971,12 @@ handle_pure_call (gimple stmt, VEC(ce_s, heap) **results)
rhsc.var = uses->id;
rhsc.offset = 0;
rhsc.type = SCALAR;
- VEC_safe_push (ce_s, heap, *results, &rhsc);
+ VEC_safe_push (ce_s, heap, *results, rhsc);
}
rhsc.var = nonlocal_id;
rhsc.offset = 0;
rhsc.type = SCALAR;
- VEC_safe_push (ce_s, heap, *results, &rhsc);
+ VEC_safe_push (ce_s, heap, *results, rhsc);
}
@@ -4412,7 +4412,7 @@ find_func_aliases_for_call (gimple t)
&& DECL_BY_REFERENCE (DECL_RESULT (fndecl)))
{
VEC(ce_s, heap) *tem = NULL;
- VEC_safe_push (ce_s, heap, tem, &rhs);
+ VEC_safe_push (ce_s, heap, tem, rhs);
do_deref (&tem);
rhs = VEC_index (ce_s, tem, 0);
VEC_free(ce_s, heap, tem);
@@ -4549,7 +4549,7 @@ find_func_aliases (gimple origt)
get_constraint_for_rhs (gimple_assign_rhs2 (t), &rhsc);
get_constraint_for_rhs (gimple_assign_rhs3 (t), &tmp);
FOR_EACH_VEC_ELT (ce_s, tmp, i, rhsp)
- VEC_safe_push (ce_s, heap, rhsc, rhsp);
+ VEC_safe_push (ce_s, heap, rhsc, *rhsp);
VEC_free (ce_s, heap, tmp);
}
else if (truth_value_p (code))
@@ -4567,7 +4567,7 @@ find_func_aliases (gimple origt)
{
get_constraint_for_rhs (gimple_op (t, i), &tmp);
FOR_EACH_VEC_ELT (ce_s, tmp, j, rhsp)
- VEC_safe_push (ce_s, heap, rhsc, rhsp);
+ VEC_safe_push (ce_s, heap, rhsc, *rhsp);
VEC_truncate (ce_s, tmp, 0);
}
VEC_free (ce_s, heap, tmp);
@@ -5191,13 +5191,8 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (!pair
&& offset + foff != 0)
{
- pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
- pair->offset = 0;
- pair->size = offset + foff;
- pair->has_unknown_size = false;
- pair->must_have_pointers = false;
- pair->may_have_pointers = false;
- pair->only_restrict_pointers = false;
+ fieldoff_s e = {0, offset + foff, false, false, false, false};
+ pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, e);
}
if (!DECL_SIZE (field)
@@ -5217,19 +5212,20 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
}
else
{
- pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
- pair->offset = offset + foff;
- pair->has_unknown_size = has_unknown_size;
+ fieldoff_s e;
+ e.offset = offset + foff;
+ e.has_unknown_size = has_unknown_size;
if (!has_unknown_size)
- pair->size = TREE_INT_CST_LOW (DECL_SIZE (field));
+ e.size = TREE_INT_CST_LOW (DECL_SIZE (field));
else
- pair->size = -1;
- pair->must_have_pointers = must_have_pointers_p;
- pair->may_have_pointers = true;
- pair->only_restrict_pointers
+ e.size = -1;
+ e.must_have_pointers = must_have_pointers_p;
+ e.may_have_pointers = true;
+ e.only_restrict_pointers
= (!has_unknown_size
&& POINTER_TYPE_P (TREE_TYPE (field))
&& TYPE_RESTRICT (TREE_TYPE (field)));
+ VEC_safe_push (fieldoff_s, heap, *fieldstack, e);
}
}