This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Minor infrastructure change (delete_unreachable_blocks)


Jeffrey A Law writes:
> It would be nice to have a routine to identify, but not remove unreachable
> blocks in the CFG for some stuff I'm working on right now.
> 
> While I could simply copy what I need from flow.c it seems rather silly
> to have that kind of code duplication.  
> 
> So instead I just broke out the code to detect unreachable blocks from
> delete_unreachable_blocks.  The new routine (find_unreachable_blocks) is
> externally visible.
> 
> 	* flow.c (find_unreachable_blocks): New function.
> 	(delete_unreachable_blocks): Use find_unreachable_blocks.
> 	* basic-block.h (find_unreachable_blocks): Declare.

Did you forget to insert a call to find_unreachable_blocks?  With your
change, GCC crashes trying to compile this on powerpc-unknown-linux-gnu:

        void foo (void) { loop: goto loop; }

This was bootstrapped on powerpc-linux-unknown-gnu:

2001-06-19  Lars Brinkhoff  <lars@nocrew.org>

	* flow.c (delete_unreachable_blocks): call find_unreachable_blocks.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.399
diff -c -3 -p -r1.399 flow.c
*** flow.c	2001/06/18 19:46:36	1.399
--- flow.c	2001/06/19 12:38:44
*************** delete_unreachable_blocks ()
*** 2108,2113 ****
--- 2108,2115 ----
  {
    int i;
  
+   find_unreachable_blocks ();
+ 
    /* Delete all unreachable basic blocks.  Count down so that we
       don't interfere with the block renumbering that happens in
       flow_delete_block.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]