This is the mail archive of the gcc@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: CFG problems on alpha


> On Thu, Oct 25, 2001 at 03:26:38PM +0200, Jan Hubicka wrote:
> > I've just checked that and it don't appear to be the case, as
> > try_optimize_cfg always cleansup and find_unrechable_blocks don't
> > use aux.
> 
> It is the case.  It's a typo.  You set a bit on an edge
> instead of a block, and those don't get cleaned up.
> 
> *** cfgcleanup.c        2001/10/23 13:34:23     1.10
> --- cfgcleanup.c        2001/10/26 07:11:53
> *************** merge_blocks (e, b, c, mode)
> *** 490,496 ****
>         {
>           if (b_fallthru_edge->src == ENTRY_BLOCK_PTR)
>             return false;
> -         BB_SET_FLAG (b_fallthru_edge, BB_UPDATE_LIFE);
>           notice_new_block (force_nonfallthru (b_fallthru_edge));
>         }
>         merge_blocks_move_predecessor_nojumps (b, c);
> 
> 
> However, I can't figure out why this is here.  You've just insertted
> a branch in a new block, and notice_new_block takes care of updating
> the new block.  So what's this?
Uhm, I now remember what I was shooting for - what I need to handle is
the case that force_nonfallthru will insert the jump at the end of
basic block, instead of creating new.
The b_fallthru_edge has been supposed to be b_fallthru_edge->src of course :(

> !         BB_SET_FLAG (b_fallthru_edge->src, BB_UPDATE_LIFE);

I've found another latent bug in merge_blocks_nomove - it does not update
the global_live_at_end flag of basic block. The attached patch should solve
it, I am just bootstrapping it.  OK if it passes?

Sat Oct 27 00:14:41 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* cfgrtl.c (merge_blocks_nomove):  Update life info properly.

Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 cfgrtl.c
*** cfgrtl.c	2001/10/11 03:15:24	1.4
--- cfgrtl.c	2001/10/26 22:14:27
*************** merge_blocks_nomove (a, b)
*** 603,608 ****
--- 603,609 ----
  
    /* B hasn't quite yet ceased to exist.  Attempt to prevent mishap.  */
    b->pred = b->succ = NULL;
+   a->global_live_at_end = b->global_live_at_end;
  
    expunge_block (b);
  


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