This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
obvious try_optimize_cfg and verify_flow_info fixes
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com, patches at x86-64 dot org
- Subject: obvious try_optimize_cfg and verify_flow_info fixes
- From: Jan Hubicka <jh at suse dot cz>
- Date: Thu, 12 Jul 2001 17:46:22 +0200
Hi,
this patch contains two fixes I decided to install as obvious.
FIrst one is causing crash on m68k bootstrap (if you are patient enought).
When the trivially dead blocks happends to be chained, the test afterwards
travels NULL pointer.
Second part just cleans up the diagnostics a bit, as I've forgot to do that
before installing the patch.
Honza
Thu Jul 12 17:42:53 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (try_optimize_cfg): Delete whole chain of trivially dead
basic blocks.
(verify_flow_info): Make diagnostics prettier.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.420
diff -c -3 -p -r1.420 flow.c
*** flow.c 2001/07/12 14:52:51 1.420
--- flow.c 2001/07/12 15:33:48
*************** try_optimize_cfg (mode)
*** 3653,3662 ****
edge s;
int changed_here = 0;
! /* Delete trivially dead basic block. */
! if (b->pred == NULL)
{
! c = BASIC_BLOCK (i - 1);
if (rtl_dump_file)
fprintf (rtl_dump_file, "Deleting block %i.\n", b->index);
flow_delete_block (b);
--- 3653,3662 ----
edge s;
int changed_here = 0;
! /* Delete trivially dead basic blocks. */
! while (b->pred == NULL)
{
! c = BASIC_BLOCK (b->index - 1);
if (rtl_dump_file)
fprintf (rtl_dump_file, "Deleting block %i.\n", b->index);
flow_delete_block (b);
*************** verify_flow_info ()
*** 7923,7945 ****
&& (e->src->index + 1 != e->dest->index
|| !can_fallthru (e->src, e->dest)))
{
! fprintf (stderr,
! "verify_flow_info: Incorrect fallthru edge %i->%i\n",
! e->src->index, e->dest->index);
! fflush (stderr);
err = 1;
}
if (e->src != bb)
{
! fprintf (stderr,
! "verify_flow_info: Basic block %d succ edge is corrupted\n",
! bb->index);
fprintf (stderr, "Predecessor: ");
dump_edge_info (stderr, e, 0);
fprintf (stderr, "\nSuccessor: ");
dump_edge_info (stderr, e, 1);
! fflush (stderr);
err = 1;
}
if (e->dest != EXIT_BLOCK_PTR)
--- 7923,7942 ----
&& (e->src->index + 1 != e->dest->index
|| !can_fallthru (e->src, e->dest)))
{
! error ("verify_flow_info: Incorrect fallthru edge %i->%i",
! e->src->index, e->dest->index);
err = 1;
}
if (e->src != bb)
{
! error ("verify_flow_info: Basic block %d succ edge is corrupted",
! bb->index);
fprintf (stderr, "Predecessor: ");
dump_edge_info (stderr, e, 0);
fprintf (stderr, "\nSuccessor: ");
dump_edge_info (stderr, e, 1);
! fprintf (stderr, "\n");
err = 1;
}
if (e->dest != EXIT_BLOCK_PTR)