/* True if this represents a IPA function info. */
unsigned int is_fn_info : 1;
+ /* True if this appears as RHS in a ADDRESSOF constraint. */
+ unsigned int address_taken : 1;
+
/* ??? Store somewhere better. */
unsigned short ruid;
ret->is_global_var = (t == NULL_TREE);
ret->is_ipa_escape_point = false;
ret->is_fn_info = false;
+ ret->address_taken = false;
if (t && DECL_P (t))
ret->is_global_var = (is_global_var (t)
/* We have to treat even local register variables
fprintf (file, "&");
else if (c->lhs.type == DEREF)
fprintf (file, "*");
- fprintf (file, "%s", get_varinfo (c->lhs.var)->name);
+ if (dump_file)
+ fprintf (file, "%s", get_varinfo (c->lhs.var)->name);
+ else
+ fprintf (file, "V%d", c->lhs.var);
if (c->lhs.offset == UNKNOWN_OFFSET)
fprintf (file, " + UNKNOWN");
else if (c->lhs.offset != 0)
fprintf (file, "&");
else if (c->rhs.type == DEREF)
fprintf (file, "*");
- fprintf (file, "%s", get_varinfo (c->rhs.var)->name);
+ if (dump_file)
+ fprintf (file, "%s", get_varinfo (c->rhs.var)->name);
+ else
+ fprintf (file, "V%d", c->rhs.var);
if (c->rhs.offset == UNKNOWN_OFFSET)
fprintf (file, " + UNKNOWN");
else if (c->rhs.offset != 0)
else
{
gcc_assert (rhs.type != ADDRESSOF || rhs.offset == 0);
+ if (rhs.type == ADDRESSOF)
+ get_varinfo (get_varinfo (rhs.var)->head)->address_taken = true;
constraints.safe_push (t);
}
}
unsigned int *map = XNEWVEC (unsigned int, varmap.length ());
for (unsigned i = 0; i < integer_id + 1; ++i)
map[i] = i;
- /* Start with non-register vars (as possibly address-taken), followed
- by register vars as conservative set of vars never appearing in
- the points-to solution bitmaps. */
+ /* Start with address-taken vars, followed by not address-taken vars
+ to move vars never appearing in the points-to solution bitmaps last. */
unsigned j = integer_id + 1;
for (unsigned i = integer_id + 1; i < varmap.length (); ++i)
- if (! varmap[i]->is_reg_var)
+ if (varmap[varmap[i]->head]->address_taken)
map[i] = j++;
for (unsigned i = integer_id + 1; i < varmap.length (); ++i)
- if (varmap[i]->is_reg_var)
+ if (! varmap[varmap[i]->head]->address_taken)
map[i] = j++;
/* Shuffle varmap according to map. */
for (unsigned i = integer_id + 1; i < varmap.length (); ++i)