graph->zero_weight_succs[from]);
}
- /* Merge all the non-zero weighted predecessor edges. */
+ /* Merge all the nonzero weighted predecessor edges. */
for (i = 0; VEC_iterate (constraint_edge_t, predvec, i, c); i++)
{
unsigned int d = c->dest;
}
- /* Merge all the non-zero weighted successor edges. */
+ /* Merge all the nonzero weighted successor edges. */
for (i = 0; VEC_iterate (constraint_edge_t, succvec, i, c); i++)
{
unsigned int d = c->dest;
struct constraint_expr *c;
unsigned int i;
tree exp = TREE_OPERAND (t, 0);
+ tree pttype = TREE_TYPE (TREE_TYPE (t));
get_constraint_for (exp, results);
/* Make sure we capture constraints to all elements
VEC_safe_push (ce_s, heap, *results, &tmp);
}
}
+ else if (VEC_length (ce_s, *results) == 1
+ && (AGGREGATE_TYPE_P (pttype)
+ || TREE_CODE (pttype) == COMPLEX_TYPE))
+ {
+ struct constraint_expr *origrhs;
+ varinfo_t origvar;
+ struct constraint_expr tmp;
+
+ gcc_assert (VEC_length (ce_s, *results) == 1);
+ origrhs = VEC_last (ce_s, *results);
+ tmp = *origrhs;
+ VEC_pop (ce_s, *results);
+ origvar = get_varinfo (origrhs->var);
+ for (; origvar; origvar = origvar->next)
+ {
+ tmp.var = origvar->id;
+ VEC_safe_push (ce_s, heap, *results, &tmp);
+ }
+ }
+
for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
{
if (c->type == DEREF)
VEC (ce_s, heap) *temp = NULL;
unsigned int rhsoffset = 0;
- if (TREE_CODE (expr) != PLUS_EXPR)
+ if (TREE_CODE (expr) != PLUS_EXPR
+ && TREE_CODE (expr) != MINUS_EXPR)
return false;
op0 = TREE_OPERAND (expr, 0);
get_constraint_for (op0, &temp);
if (POINTER_TYPE_P (TREE_TYPE (op0))
- && TREE_CODE (op1) == INTEGER_CST)
+ && TREE_CODE (op1) == INTEGER_CST
+ && TREE_CODE (expr) == PLUS_EXPR)
{
rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT;
}
/* Now build constraints expressions. */
if (TREE_CODE (t) == PHI_NODE)
{
+ gcc_assert (!AGGREGATE_TYPE_P (TREE_TYPE (PHI_RESULT (t))));
+
/* Only care about pointers and structures containing
pointers. */
if (POINTER_TYPE_P (TREE_TYPE (PHI_RESULT (t)))
- || AGGREGATE_TYPE_P (TREE_TYPE (PHI_RESULT (t))))
+ || TREE_CODE (TREE_TYPE (PHI_RESULT (t))) == COMPLEX_TYPE)
{
int i;
unsigned int j;
rhstype = TREE_TYPE (strippedrhs);
get_constraint_for (PHI_ARG_DEF (t, i), &rhsc);
- if (TREE_CODE (strippedrhs) == ADDR_EXPR
- && AGGREGATE_TYPE_P (TREE_TYPE (rhstype))
- && VEC_length (ce_s, rhsc) == 1)
- {
- struct constraint_expr *origrhs;
- varinfo_t origvar;
- struct constraint_expr tmp;
-
- gcc_assert (VEC_length (ce_s, rhsc) == 1);
- origrhs = VEC_last (ce_s, rhsc);
- tmp = *origrhs;
- VEC_pop (ce_s, rhsc);
- origvar = get_varinfo (origrhs->var);
- for (; origvar; origvar = origvar->next)
- {
- tmp.var = origvar->id;
- VEC_safe_push (ce_s, heap, rhsc, &tmp);
- }
- }
-
for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
{
struct constraint_expr *c2;
tree lhsop;
tree rhsop;
unsigned int varid;
- bool found = false;
tree arglist;
varinfo_t fi;
int i = 1;
we should still be able to handle. */
if (decl)
{
- found = lookup_id_for_tree (decl, &varid);
- gcc_assert (found);
+ varid = get_id_for_tree (decl);
}
else
{
decl = TREE_OPERAND (rhsop, 0);
- found = lookup_id_for_tree (decl, &varid);
- gcc_assert (found);
+ varid = get_id_for_tree (decl);
}
/* Assign all the passed arguments to the appropriate incoming
tree rhsop = TREE_OPERAND (t, 1);
int i;
- if (AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
- && AGGREGATE_TYPE_P (TREE_TYPE (rhsop)))
+ if ((AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
+ || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE)
+ && (AGGREGATE_TYPE_P (TREE_TYPE (rhsop))
+ || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE))
{
do_structure_copy (lhsop, rhsop);
}
containing pointers, dereferences, and call expressions. */
if (POINTER_TYPE_P (TREE_TYPE (lhsop))
|| AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
+ || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE
|| TREE_CODE (rhsop) == CALL_EXPR)
{
get_constraint_for (lhsop, &lhsc);
case tcc_unary:
{
unsigned int j;
- tree strippedrhs = rhsop;
- tree rhstype;
-
- /* XXX: Push this back into the ADDR_EXPR
- case, and remove anyoffset handling. */
- STRIP_NOPS (strippedrhs);
- rhstype = TREE_TYPE (strippedrhs);
-
- get_constraint_for (rhsop, &rhsc);
- if (TREE_CODE (strippedrhs) == ADDR_EXPR
- && AGGREGATE_TYPE_P (TREE_TYPE (rhstype))
- && VEC_length (ce_s, rhsc) == 1)
- {
- struct constraint_expr *origrhs;
- varinfo_t origvar;
- struct constraint_expr tmp;
-
- gcc_assert (VEC_length (ce_s, rhsc) == 1);
- origrhs = VEC_last (ce_s, rhsc);
- tmp = *origrhs;
- VEC_pop (ce_s, rhsc);
- origvar = get_varinfo (origrhs->var);
- for (; origvar; origvar = origvar->next)
- {
- tmp.var = origvar->id;
- VEC_safe_push (ce_s, heap, rhsc, &tmp);
- }
- }
+ get_constraint_for (rhsop, &rhsc);
for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
{
struct constraint_expr *c2;
arg = DECL_ARGUMENTS (decl);
-
/* Set up variables for each argument. */
for (i = 1; i < vi->fullsize; i++)
{
lhs.type = SCALAR;
lhs.var = create_variable_info_for (t, alias_get_name (t));
- /* With flag_argument_noalias greater than one means that the incomming
+ /* With flag_argument_noalias greater than one means that the incoming
argument cannot alias anything except for itself so create a HEAP
variable. */
if (POINTER_TYPE_P (TREE_TYPE (t))
}
/* Execute the driver for IPA PTA. */
-static void
+static unsigned int
ipa_pta_execute (void)
{
struct cgraph_node *node;
in_ipa_mode = 0;
delete_alias_heapvars ();
delete_points_to_sets ();
+ return 0;
}
struct tree_opt_pass pass_ipa_pta =