|
|
5613733 |
2009-06-23 Jakub Jelinek <jakub@redhat.com>
|
|
|
5613733 |
|
|
|
5613733 |
* var-tracking.c (unshare_variable): Force initialized to
|
|
|
5613733 |
be VAR_INIT_STATUS_INITIALIZED unless flag_var_tracking_uninit.
|
|
|
5613733 |
(set_variable_part): Likewise.
|
|
|
5613733 |
(struct variable_union_info): Remove pos_src field.
|
|
|
5613733 |
(vui_vec, vui_allocated): New variables.
|
|
|
5613733 |
(variable_union): Pass VAR_INIT_STATUS_UNKNOWN to unshare_variable
|
|
|
5613733 |
unconditionally. Avoid XCVECNEW/free for every sorting, for dst_l
|
|
|
5613733 |
== 1 use a simpler sorting algorithm. Compute pos field right
|
|
|
5613733 |
away, don't fill in pos_src. For dst_l == 2 avoid qsort.
|
|
|
5613733 |
Avoid quadratic comparison if !flag_var_tracking_uninit.
|
|
|
5613733 |
(variable_canonicalize): Pass VAR_INIT_STATUS_UNKNOWN to
|
|
|
5613733 |
unshare_variable unconditionally.
|
|
|
5613733 |
(dataflow_set_different_2): Removed.
|
|
|
5613733 |
(dataflow_set_different): Don't traverse second hash table.
|
|
|
5613733 |
(compute_bb_dataflow): Pass VAR_INIT_STATUS_UNINITIALIZED
|
|
|
5613733 |
unconditionally to var_reg_set or var_mem_set.
|
|
|
5613733 |
(emit_notes_in_bb): Likewise.
|
|
|
5613733 |
(delete_variable_part): Pass VAR_INIT_STATUS_UNKNOWN to
|
|
|
5613733 |
unshare_variable.
|
|
|
5613733 |
(emit_note_insn_var_location): Don't set initialized to
|
|
|
5613733 |
VAR_INIT_STATUS_INITIALIZED early.
|
|
|
5613733 |
(vt_finalize): Free vui_vec if needed, clear vui_vec and
|
|
|
5613733 |
vui_allocated.
|
|
|
5613733 |
|
|
|
5613733 |
--- gcc/var-tracking.c (revision 148851)
|
|
|
5613733 |
+++ gcc/var-tracking.c (revision 148852)
|
|
|
5613733 |
@@ -347,7 +347,6 @@ static void dataflow_set_union (dataflow
|
|
|
5613733 |
static bool variable_part_different_p (variable_part *, variable_part *);
|
|
|
5613733 |
static bool variable_different_p (variable, variable, bool);
|
|
|
5613733 |
static int dataflow_set_different_1 (void **, void *);
|
|
|
5613733 |
-static int dataflow_set_different_2 (void **, void *);
|
|
|
5613733 |
static bool dataflow_set_different (dataflow_set *, dataflow_set *);
|
|
|
5613733 |
static void dataflow_set_destroy (dataflow_set *);
|
|
|
5613733 |
|
|
|
5613733 |
@@ -878,6 +877,9 @@ unshare_variable (dataflow_set *set, var
|
|
|
5613733 |
var->refcount--;
|
|
|
5613733 |
new_var->n_var_parts = var->n_var_parts;
|
|
|
5613733 |
|
|
|
5613733 |
+ if (! flag_var_tracking_uninit)
|
|
|
5613733 |
+ initialized = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
+
|
|
|
5613733 |
for (i = 0; i < var->n_var_parts; i++)
|
|
|
5613733 |
{
|
|
|
5613733 |
location_chain node;
|
|
|
5613733 |
@@ -1202,11 +1204,14 @@ struct variable_union_info
|
|
|
5613733 |
/* The sum of positions in the input chains. */
|
|
|
5613733 |
int pos;
|
|
|
5613733 |
|
|
|
5613733 |
- /* The position in the chains of SRC and DST dataflow sets. */
|
|
|
5613733 |
- int pos_src;
|
|
|
5613733 |
+ /* The position in the chain of DST dataflow set. */
|
|
|
5613733 |
int pos_dst;
|
|
|
5613733 |
};
|
|
|
5613733 |
|
|
|
5613733 |
+/* Buffer for location list sorting and its allocated size. */
|
|
|
5613733 |
+static struct variable_union_info *vui_vec;
|
|
|
5613733 |
+static int vui_allocated;
|
|
|
5613733 |
+
|
|
|
5613733 |
/* Compare function for qsort, order the structures by POS element. */
|
|
|
5613733 |
|
|
|
5613733 |
static int
|
|
|
5613733 |
@@ -1263,14 +1268,9 @@ variable_union (void **slot, void *data)
|
|
|
5613733 |
}
|
|
|
5613733 |
if (k < src->n_var_parts)
|
|
|
5613733 |
{
|
|
|
5613733 |
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
|
|
5613733 |
-
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
-
|
|
|
5613733 |
if (dstp)
|
|
|
5613733 |
*dstp = (void *) src;
|
|
|
5613733 |
- unshare_variable (set, src, status);
|
|
|
5613733 |
+ unshare_variable (set, src, VAR_INIT_STATUS_UNKNOWN);
|
|
|
5613733 |
}
|
|
|
5613733 |
else
|
|
|
5613733 |
{
|
|
|
5613733 |
@@ -1311,13 +1311,7 @@ variable_union (void **slot, void *data)
|
|
|
5613733 |
|
|
|
5613733 |
if ((dst->refcount > 1 || shared_hash_shared (set->vars))
|
|
|
5613733 |
&& dst->n_var_parts != k)
|
|
|
5613733 |
- {
|
|
|
5613733 |
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
|
|
5613733 |
-
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
- dst = unshare_variable (set, dst, status);
|
|
|
5613733 |
- }
|
|
|
5613733 |
+ dst = unshare_variable (set, dst, VAR_INIT_STATUS_UNKNOWN);
|
|
|
5613733 |
|
|
|
5613733 |
i = src->n_var_parts - 1;
|
|
|
5613733 |
j = dst->n_var_parts - 1;
|
|
|
5613733 |
@@ -1366,70 +1360,152 @@ variable_union (void **slot, void *data)
|
|
|
5613733 |
dst_l = 0;
|
|
|
5613733 |
for (node = dst->var_part[j].loc_chain; node; node = node->next)
|
|
|
5613733 |
dst_l++;
|
|
|
5613733 |
- vui = XCNEWVEC (struct variable_union_info, src_l + dst_l);
|
|
|
5613733 |
|
|
|
5613733 |
- /* Fill in the locations from DST. */
|
|
|
5613733 |
- for (node = dst->var_part[j].loc_chain, jj = 0; node;
|
|
|
5613733 |
- node = node->next, jj++)
|
|
|
5613733 |
+ if (dst_l == 1)
|
|
|
5613733 |
{
|
|
|
5613733 |
- vui[jj].lc = node;
|
|
|
5613733 |
- vui[jj].pos_dst = jj;
|
|
|
5613733 |
+ /* The most common case, much simpler, no qsort is needed. */
|
|
|
5613733 |
+ location_chain dstnode = dst->var_part[j].loc_chain;
|
|
|
5613733 |
+ dst->var_part[k].loc_chain = dstnode;
|
|
|
5613733 |
+ dst->var_part[k].offset = dst->var_part[j].offset;
|
|
|
5613733 |
+ node2 = dstnode;
|
|
|
5613733 |
+ for (node = src->var_part[i].loc_chain; node; node = node->next)
|
|
|
5613733 |
+ if (!((REG_P (dstnode->loc)
|
|
|
5613733 |
+ && REG_P (node->loc)
|
|
|
5613733 |
+ && REGNO (dstnode->loc) == REGNO (node->loc))
|
|
|
5613733 |
+ || rtx_equal_p (dstnode->loc, node->loc)))
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ location_chain new_node;
|
|
|
5613733 |
|
|
|
5613733 |
- /* Value larger than a sum of 2 valid positions. */
|
|
|
5613733 |
- vui[jj].pos_src = src_l + dst_l;
|
|
|
5613733 |
+ /* Copy the location from SRC. */
|
|
|
5613733 |
+ new_node = (location_chain) pool_alloc (loc_chain_pool);
|
|
|
5613733 |
+ new_node->loc = node->loc;
|
|
|
5613733 |
+ new_node->init = node->init;
|
|
|
5613733 |
+ if (!node->set_src || MEM_P (node->set_src))
|
|
|
5613733 |
+ new_node->set_src = NULL;
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ new_node->set_src = node->set_src;
|
|
|
5613733 |
+ node2->next = new_node;
|
|
|
5613733 |
+ node2 = new_node;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ node2->next = NULL;
|
|
|
5613733 |
}
|
|
|
5613733 |
-
|
|
|
5613733 |
- /* Fill in the locations from SRC. */
|
|
|
5613733 |
- n = dst_l;
|
|
|
5613733 |
- for (node = src->var_part[i].loc_chain, ii = 0; node;
|
|
|
5613733 |
- node = node->next, ii++)
|
|
|
5613733 |
+ else
|
|
|
5613733 |
{
|
|
|
5613733 |
- /* Find location from NODE. */
|
|
|
5613733 |
- for (jj = 0; jj < dst_l; jj++)
|
|
|
5613733 |
+ if (src_l + dst_l > vui_allocated)
|
|
|
5613733 |
{
|
|
|
5613733 |
- if ((REG_P (vui[jj].lc->loc)
|
|
|
5613733 |
- && REG_P (node->loc)
|
|
|
5613733 |
- && REGNO (vui[jj].lc->loc) == REGNO (node->loc))
|
|
|
5613733 |
- || rtx_equal_p (vui[jj].lc->loc, node->loc))
|
|
|
5613733 |
- {
|
|
|
5613733 |
- vui[jj].pos_src = ii;
|
|
|
5613733 |
- break;
|
|
|
5613733 |
- }
|
|
|
5613733 |
+ vui_allocated = MAX (vui_allocated * 2, src_l + dst_l);
|
|
|
5613733 |
+ vui_vec = XRESIZEVEC (struct variable_union_info, vui_vec,
|
|
|
5613733 |
+ vui_allocated);
|
|
|
5613733 |
}
|
|
|
5613733 |
- if (jj >= dst_l) /* The location has not been found. */
|
|
|
5613733 |
+ vui = vui_vec;
|
|
|
5613733 |
+
|
|
|
5613733 |
+ /* Fill in the locations from DST. */
|
|
|
5613733 |
+ for (node = dst->var_part[j].loc_chain, jj = 0; node;
|
|
|
5613733 |
+ node = node->next, jj++)
|
|
|
5613733 |
{
|
|
|
5613733 |
- location_chain new_node;
|
|
|
5613733 |
+ vui[jj].lc = node;
|
|
|
5613733 |
+ vui[jj].pos_dst = jj;
|
|
|
5613733 |
|
|
|
5613733 |
- /* Copy the location from SRC. */
|
|
|
5613733 |
- new_node = (location_chain) pool_alloc (loc_chain_pool);
|
|
|
5613733 |
- new_node->loc = node->loc;
|
|
|
5613733 |
- new_node->init = node->init;
|
|
|
5613733 |
- if (!node->set_src || MEM_P (node->set_src))
|
|
|
5613733 |
- new_node->set_src = NULL;
|
|
|
5613733 |
- else
|
|
|
5613733 |
- new_node->set_src = node->set_src;
|
|
|
5613733 |
- vui[n].lc = new_node;
|
|
|
5613733 |
- vui[n].pos_src = ii;
|
|
|
5613733 |
- vui[n].pos_dst = src_l + dst_l;
|
|
|
5613733 |
- n++;
|
|
|
5613733 |
+ /* Pos plus value larger than a sum of 2 valid positions. */
|
|
|
5613733 |
+ vui[jj].pos = jj + src_l + dst_l;
|
|
|
5613733 |
}
|
|
|
5613733 |
- }
|
|
|
5613733 |
|
|
|
5613733 |
- for (ii = 0; ii < src_l + dst_l; ii++)
|
|
|
5613733 |
- vui[ii].pos = vui[ii].pos_src + vui[ii].pos_dst;
|
|
|
5613733 |
+ /* Fill in the locations from SRC. */
|
|
|
5613733 |
+ n = dst_l;
|
|
|
5613733 |
+ for (node = src->var_part[i].loc_chain, ii = 0; node;
|
|
|
5613733 |
+ node = node->next, ii++)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ /* Find location from NODE. */
|
|
|
5613733 |
+ for (jj = 0; jj < dst_l; jj++)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ if ((REG_P (vui[jj].lc->loc)
|
|
|
5613733 |
+ && REG_P (node->loc)
|
|
|
5613733 |
+ && REGNO (vui[jj].lc->loc) == REGNO (node->loc))
|
|
|
5613733 |
+ || rtx_equal_p (vui[jj].lc->loc, node->loc))
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ vui[jj].pos = jj + ii;
|
|
|
5613733 |
+ break;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ if (jj >= dst_l) /* The location has not been found. */
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ location_chain new_node;
|
|
|
5613733 |
|
|
|
5613733 |
- qsort (vui, n, sizeof (struct variable_union_info),
|
|
|
5613733 |
- variable_union_info_cmp_pos);
|
|
|
5613733 |
+ /* Copy the location from SRC. */
|
|
|
5613733 |
+ new_node = (location_chain) pool_alloc (loc_chain_pool);
|
|
|
5613733 |
+ new_node->loc = node->loc;
|
|
|
5613733 |
+ new_node->init = node->init;
|
|
|
5613733 |
+ if (!node->set_src || MEM_P (node->set_src))
|
|
|
5613733 |
+ new_node->set_src = NULL;
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ new_node->set_src = node->set_src;
|
|
|
5613733 |
+ vui[n].lc = new_node;
|
|
|
5613733 |
+ vui[n].pos_dst = src_l + dst_l;
|
|
|
5613733 |
+ vui[n].pos = ii + src_l + dst_l;
|
|
|
5613733 |
+ n++;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ }
|
|
|
5613733 |
|
|
|
5613733 |
- /* Reconnect the nodes in sorted order. */
|
|
|
5613733 |
- for (ii = 1; ii < n; ii++)
|
|
|
5613733 |
- vui[ii - 1].lc->next = vui[ii].lc;
|
|
|
5613733 |
- vui[n - 1].lc->next = NULL;
|
|
|
5613733 |
+ if (dst_l == 2)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ /* Special case still very common case. For dst_l == 2
|
|
|
5613733 |
+ all entries dst_l ... n-1 are sorted, with for i >= dst_l
|
|
|
5613733 |
+ vui[i].pos == i + src_l + dst_l. */
|
|
|
5613733 |
+ if (vui[0].pos > vui[1].pos)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ /* Order should be 1, 0, 2... */
|
|
|
5613733 |
+ dst->var_part[k].loc_chain = vui[1].lc;
|
|
|
5613733 |
+ vui[1].lc->next = vui[0].lc;
|
|
|
5613733 |
+ if (n >= 3)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ vui[0].lc->next = vui[2].lc;
|
|
|
5613733 |
+ vui[n - 1].lc->next = NULL;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ vui[0].lc->next = NULL;
|
|
|
5613733 |
+ ii = 3;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ dst->var_part[k].loc_chain = vui[0].lc;
|
|
|
5613733 |
+ if (n >= 3 && vui[2].pos < vui[1].pos)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ /* Order should be 0, 2, 1, 3... */
|
|
|
5613733 |
+ vui[0].lc->next = vui[2].lc;
|
|
|
5613733 |
+ vui[2].lc->next = vui[1].lc;
|
|
|
5613733 |
+ if (n >= 4)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ vui[1].lc->next = vui[3].lc;
|
|
|
5613733 |
+ vui[n - 1].lc->next = NULL;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ vui[1].lc->next = NULL;
|
|
|
5613733 |
+ ii = 4;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ /* Order should be 0, 1, 2... */
|
|
|
5613733 |
+ ii = 1;
|
|
|
5613733 |
+ vui[n - 1].lc->next = NULL;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ for (; ii < n; ii++)
|
|
|
5613733 |
+ vui[ii - 1].lc->next = vui[ii].lc;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ else
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ qsort (vui, n, sizeof (struct variable_union_info),
|
|
|
5613733 |
+ variable_union_info_cmp_pos);
|
|
|
5613733 |
|
|
|
5613733 |
- dst->var_part[k].loc_chain = vui[0].lc;
|
|
|
5613733 |
- dst->var_part[k].offset = dst->var_part[j].offset;
|
|
|
5613733 |
+ /* Reconnect the nodes in sorted order. */
|
|
|
5613733 |
+ for (ii = 1; ii < n; ii++)
|
|
|
5613733 |
+ vui[ii - 1].lc->next = vui[ii].lc;
|
|
|
5613733 |
+ vui[n - 1].lc->next = NULL;
|
|
|
5613733 |
+ dst->var_part[k].loc_chain = vui[0].lc;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
|
|
|
5613733 |
- free (vui);
|
|
|
5613733 |
+ dst->var_part[k].offset = dst->var_part[j].offset;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
i--;
|
|
|
5613733 |
j--;
|
|
|
5613733 |
}
|
|
|
5613733 |
@@ -1477,17 +1553,18 @@ variable_union (void **slot, void *data)
|
|
|
5613733 |
dst->var_part[k].cur_loc = NULL;
|
|
|
5613733 |
}
|
|
|
5613733 |
|
|
|
5613733 |
- for (i = 0; i < src->n_var_parts && i < dst->n_var_parts; i++)
|
|
|
5613733 |
- {
|
|
|
5613733 |
- location_chain node, node2;
|
|
|
5613733 |
- for (node = src->var_part[i].loc_chain; node; node = node->next)
|
|
|
5613733 |
- for (node2 = dst->var_part[i].loc_chain; node2; node2 = node2->next)
|
|
|
5613733 |
- if (rtx_equal_p (node->loc, node2->loc))
|
|
|
5613733 |
- {
|
|
|
5613733 |
- if (node->init > node2->init)
|
|
|
5613733 |
- node2->init = node->init;
|
|
|
5613733 |
- }
|
|
|
5613733 |
- }
|
|
|
5613733 |
+ if (flag_var_tracking_uninit)
|
|
|
5613733 |
+ for (i = 0; i < src->n_var_parts && i < dst->n_var_parts; i++)
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ location_chain node, node2;
|
|
|
5613733 |
+ for (node = src->var_part[i].loc_chain; node; node = node->next)
|
|
|
5613733 |
+ for (node2 = dst->var_part[i].loc_chain; node2; node2 = node2->next)
|
|
|
5613733 |
+ if (rtx_equal_p (node->loc, node2->loc))
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ if (node->init > node2->init)
|
|
|
5613733 |
+ node2->init = node->init;
|
|
|
5613733 |
+ }
|
|
|
5613733 |
+ }
|
|
|
5613733 |
|
|
|
5613733 |
/* Continue traversing the hash table. */
|
|
|
5613733 |
return 1;
|
|
|
5613733 |
@@ -1522,14 +1599,7 @@ variable_canonicalize (void **slot, void
|
|
|
5613733 |
}
|
|
|
5613733 |
}
|
|
|
5613733 |
if (k < src->n_var_parts)
|
|
|
5613733 |
- {
|
|
|
5613733 |
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
|
|
5613733 |
-
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
-
|
|
|
5613733 |
- unshare_variable (set, src, status);
|
|
|
5613733 |
- }
|
|
|
5613733 |
+ unshare_variable (set, src, VAR_INIT_STATUS_UNKNOWN);
|
|
|
5613733 |
return 1;
|
|
|
5613733 |
}
|
|
|
5613733 |
|
|
|
5613733 |
@@ -1650,34 +1720,6 @@ dataflow_set_different_1 (void **slot, v
|
|
|
5613733 |
return 1;
|
|
|
5613733 |
}
|
|
|
5613733 |
|
|
|
5613733 |
-/* Compare variable *SLOT with the same variable in hash table DATA
|
|
|
5613733 |
- and set DATAFLOW_SET_DIFFERENT_VALUE if they are different. */
|
|
|
5613733 |
-
|
|
|
5613733 |
-static int
|
|
|
5613733 |
-dataflow_set_different_2 (void **slot, void *data)
|
|
|
5613733 |
-{
|
|
|
5613733 |
- htab_t htab = (htab_t) data;
|
|
|
5613733 |
- variable var1, var2;
|
|
|
5613733 |
-
|
|
|
5613733 |
- var1 = *(variable *) slot;
|
|
|
5613733 |
- var2 = (variable) htab_find_with_hash (htab, var1->decl,
|
|
|
5613733 |
- VARIABLE_HASH_VAL (var1->decl));
|
|
|
5613733 |
- if (!var2)
|
|
|
5613733 |
- {
|
|
|
5613733 |
- dataflow_set_different_value = true;
|
|
|
5613733 |
-
|
|
|
5613733 |
- /* Stop traversing the hash table. */
|
|
|
5613733 |
- return 0;
|
|
|
5613733 |
- }
|
|
|
5613733 |
-
|
|
|
5613733 |
- /* If both variables are defined they have been already checked for
|
|
|
5613733 |
- equivalence. */
|
|
|
5613733 |
- gcc_assert (!variable_different_p (var1, var2, false));
|
|
|
5613733 |
-
|
|
|
5613733 |
- /* Continue traversing the hash table. */
|
|
|
5613733 |
- return 1;
|
|
|
5613733 |
-}
|
|
|
5613733 |
-
|
|
|
5613733 |
/* Return true if dataflow sets OLD_SET and NEW_SET differ. */
|
|
|
5613733 |
|
|
|
5613733 |
static bool
|
|
|
5613733 |
@@ -1694,14 +1736,9 @@ dataflow_set_different (dataflow_set *ol
|
|
|
5613733 |
|
|
|
5613733 |
htab_traverse (shared_hash_htab (old_set->vars), dataflow_set_different_1,
|
|
|
5613733 |
shared_hash_htab (new_set->vars));
|
|
|
5613733 |
- if (!dataflow_set_different_value)
|
|
|
5613733 |
- {
|
|
|
5613733 |
- /* We have compared the variables which are in both hash tables
|
|
|
5613733 |
- so now only check whether there are some variables in NEW_SET->VARS
|
|
|
5613733 |
- which are not in OLD_SET->VARS. */
|
|
|
5613733 |
- htab_traverse (shared_hash_htab (new_set->vars), dataflow_set_different_2,
|
|
|
5613733 |
- shared_hash_htab (old_set->vars));
|
|
|
5613733 |
- }
|
|
|
5613733 |
+ /* No need to traverse the second hashtab, if both have the same number
|
|
|
5613733 |
+ of elements and the second one had all entries found in the first one,
|
|
|
5613733 |
+ then it can't have any extra entries. */
|
|
|
5613733 |
return dataflow_set_different_value;
|
|
|
5613733 |
}
|
|
|
5613733 |
|
|
|
5613733 |
@@ -2215,15 +2252,11 @@ compute_bb_dataflow (basic_block bb)
|
|
|
5613733 |
case MO_USE:
|
|
|
5613733 |
{
|
|
|
5613733 |
rtx loc = VTI (bb)->mos[i].u.loc;
|
|
|
5613733 |
- enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED;
|
|
|
5613733 |
-
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
|
|
|
5613733 |
if (GET_CODE (loc) == REG)
|
|
|
5613733 |
- var_reg_set (out, loc, status, NULL);
|
|
|
5613733 |
+ var_reg_set (out, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
|
|
5613733 |
else if (GET_CODE (loc) == MEM)
|
|
|
5613733 |
- var_mem_set (out, loc, status, NULL);
|
|
|
5613733 |
+ var_mem_set (out, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
|
|
5613733 |
}
|
|
|
5613733 |
break;
|
|
|
5613733 |
|
|
|
5613733 |
@@ -2262,10 +2295,12 @@ compute_bb_dataflow (basic_block bb)
|
|
|
5613733 |
if (! flag_var_tracking_uninit)
|
|
|
5613733 |
src_status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
else
|
|
|
5613733 |
- src_status = find_src_status (in, set_src);
|
|
|
5613733 |
+ {
|
|
|
5613733 |
+ src_status = find_src_status (in, set_src);
|
|
|
5613733 |
|
|
|
5613733 |
- if (src_status == VAR_INIT_STATUS_UNKNOWN)
|
|
|
5613733 |
- src_status = find_src_status (out, set_src);
|
|
|
5613733 |
+ if (src_status == VAR_INIT_STATUS_UNKNOWN)
|
|
|
5613733 |
+ src_status = find_src_status (out, set_src);
|
|
|
5613733 |
+ }
|
|
|
5613733 |
|
|
|
5613733 |
set_src = find_src_set_src (in, set_src);
|
|
|
5613733 |
|
|
|
5613733 |
@@ -2609,6 +2644,9 @@ set_variable_part (dataflow_set *set, rt
|
|
|
5613733 |
variable var;
|
|
|
5613733 |
void **slot = shared_hash_find_slot (set->vars, decl);
|
|
|
5613733 |
|
|
|
5613733 |
+ if (! flag_var_tracking_uninit)
|
|
|
5613733 |
+ initialized = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
+
|
|
|
5613733 |
if (!slot || !*slot)
|
|
|
5613733 |
{
|
|
|
5613733 |
if (!slot)
|
|
|
5613733 |
@@ -2815,10 +2853,8 @@ delete_variable_part (dataflow_set *set,
|
|
|
5613733 |
&& REGNO (node->loc) == REGNO (loc))
|
|
|
5613733 |
|| rtx_equal_p (node->loc, loc))
|
|
|
5613733 |
{
|
|
|
5613733 |
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
- var = unshare_variable (set, var, status);
|
|
|
5613733 |
+ var = unshare_variable (set, var,
|
|
|
5613733 |
+ VAR_INIT_STATUS_UNKNOWN);
|
|
|
5613733 |
break;
|
|
|
5613733 |
}
|
|
|
5613733 |
}
|
|
|
5613733 |
@@ -2893,9 +2929,6 @@ emit_note_insn_var_location (void **varp
|
|
|
5613733 |
|
|
|
5613733 |
gcc_assert (var->decl);
|
|
|
5613733 |
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- initialized = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
-
|
|
|
5613733 |
complete = true;
|
|
|
5613733 |
last_limit = 0;
|
|
|
5613733 |
n_var_parts = 0;
|
|
|
5613733 |
@@ -3148,14 +3181,11 @@ emit_notes_in_bb (basic_block bb)
|
|
|
5613733 |
case MO_USE:
|
|
|
5613733 |
{
|
|
|
5613733 |
rtx loc = VTI (bb)->mos[i].u.loc;
|
|
|
5613733 |
-
|
|
|
5613733 |
- enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED;
|
|
|
5613733 |
- if (! flag_var_tracking_uninit)
|
|
|
5613733 |
- status = VAR_INIT_STATUS_INITIALIZED;
|
|
|
5613733 |
+
|
|
|
5613733 |
if (GET_CODE (loc) == REG)
|
|
|
5613733 |
- var_reg_set (&set, loc, status, NULL);
|
|
|
5613733 |
+ var_reg_set (&set, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
|
|
5613733 |
else
|
|
|
5613733 |
- var_mem_set (&set, loc, status, NULL);
|
|
|
5613733 |
+ var_mem_set (&set, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
|
|
5613733 |
|
|
|
5613733 |
emit_notes_for_changes (insn, EMIT_NOTE_AFTER_INSN);
|
|
|
5613733 |
}
|
|
|
5613733 |
@@ -3553,6 +3583,10 @@ vt_finalize (void)
|
|
|
5613733 |
free_alloc_pool (var_pool);
|
|
|
5613733 |
free_alloc_pool (loc_chain_pool);
|
|
|
5613733 |
free_alloc_pool (shared_hash_pool);
|
|
|
5613733 |
+ if (vui_vec)
|
|
|
5613733 |
+ free (vui_vec);
|
|
|
5613733 |
+ vui_vec = NULL;
|
|
|
5613733 |
+ vui_allocated = 0;
|
|
|
5613733 |
}
|
|
|
5613733 |
|
|
|
5613733 |
/* The entry point to variable tracking pass. */
|