This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: Speedup compile of gcc.c-torture/compile/20001226-1.c
- To: Roman Zippel <zippel at linux-m68k dot org>
- Subject: Re: Patch: Speedup compile of gcc.c-torture/compile/20001226-1.c
- From: Richard Henderson <rth at redhat dot com>
- Date: Mon, 27 Aug 2001 14:27:18 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.33.0108242056020.8586-100000@serv>
On Fri, Aug 24, 2001 at 08:56:04PM +0200, Roman Zippel wrote:
> * flow.c (verify_flow_info): use checksum to verify edges
I appled this variant.
r~
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.472
diff -c -p -d -r1.472 flow.c
*** flow.c 2001/08/27 18:11:27 1.472
--- flow.c 2001/08/27 21:26:13
*************** verify_flow_info ()
*** 8340,8351 ****
--- 8340,8353 ----
const rtx rtx_first = get_insns ();
rtx last_head = get_last_insn ();
basic_block *bb_info, *last_visited;
+ size_t *edge_checksum;
rtx x;
int i, last_bb_num_seen, num_bb_notes, err = 0;
bb_info = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
last_visited = (basic_block *) xcalloc (n_basic_blocks + 2,
sizeof (basic_block));
+ edge_checksum = (size_t *) xcalloc (n_basic_blocks + 2, sizeof (size_t));
for (i = n_basic_blocks - 1; i >= 0; i--)
{
*************** verify_flow_info ()
*** 8396,8404 ****
for (i = n_basic_blocks - 1; i >= 0; i--)
{
basic_block bb = BASIC_BLOCK (i);
- /* Check correctness of edge lists. */
- edge e;
int has_fallthru = 0;
e = bb->succ;
while (e)
--- 8398,8405 ----
for (i = n_basic_blocks - 1; i >= 0; i--)
{
basic_block bb = BASIC_BLOCK (i);
int has_fallthru = 0;
+ edge e;
e = bb->succ;
while (e)
*************** verify_flow_info ()
*** 8447,8463 ****
fprintf (stderr, "\n");
err = 1;
}
! if (e->dest != EXIT_BLOCK_PTR)
! {
! edge e2 = e->dest->pred;
! while (e2 && e2 != e)
! e2 = e2->pred_next;
! if (!e2)
! {
! error ("Basic block %i edge lists are corrupted", bb->index);
! err = 1;
! }
! }
e = e->succ_next;
}
if (!has_fallthru)
--- 8448,8454 ----
fprintf (stderr, "\n");
err = 1;
}
! edge_checksum[e->dest->index + 2] += (size_t) e;
e = e->succ_next;
}
if (!has_fallthru)
*************** verify_flow_info ()
*** 8488,8505 ****
dump_edge_info (stderr, e, 1);
fputc ('\n', stderr);
err = 1;
- }
- if (e->src != ENTRY_BLOCK_PTR)
- {
- edge e2 = e->src->succ;
- while (e2 && e2 != e)
- e2 = e2->succ_next;
- if (!e2)
- {
- error ("Basic block %i edge lists are corrupted", bb->index);
- err = 1;
- }
}
e = e->pred_next;
}
--- 8479,8486 ----
dump_edge_info (stderr, e, 1);
fputc ('\n', stderr);
err = 1;
}
+ edge_checksum[e->dest->index + 2] -= (size_t) e;
e = e->pred_next;
}
*************** verify_flow_info ()
*** 8556,8561 ****
--- 8537,8558 ----
}
}
+ /* Complete edge checksumming for ENTRY and EXIT. */
+ {
+ edge e;
+ for (e = ENTRY_BLOCK_PTR->succ; e ; e = e->succ_next)
+ edge_checksum[e->dest->index + 2] += (size_t) e;
+ for (e = EXIT_BLOCK_PTR->pred; e ; e = e->pred_next)
+ edge_checksum[e->dest->index + 2] -= (size_t) e;
+ }
+
+ for (i = -2; i < n_basic_blocks; ++i)
+ if (edge_checksum[i + 2])
+ {
+ error ("Basic block %i edge lists are corrupted", i);
+ err = 1;
+ }
+
last_bb_num_seen = -1;
num_bb_notes = 0;
x = rtx_first;
*************** verify_flow_info ()
*** 8617,8622 ****
--- 8614,8620 ----
/* Clean up. */
free (bb_info);
free (last_visited);
+ free (edge_checksum);
}
/* Functions to access an edge list with a vector representation.