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]
Other format: [Raw text]

Re: [patch] Fix bootstrap


> On Sat, Feb 01, 2003 at 12:02:04AM +0100, Jan Hubicka wrote:
> > > Hmm?  But you were removing that loop.
> > 
> > I don't follow here.  What loop I was removing?
> 
> The one in update_life_info, I thought.
I am still not sure whether is the loop to clear registers or the loop
iterating liveness and cfg_cleanup.  Last time the patch got suck on the
second, but I guess this time you are reffering it to the first.
> 
> > You mean having global variable "life_info_reliable" that will be set to
> > 1 after full rebuild and cleared after first update?
> 
> No, a PROP_REINIT_LIFE flag (or CLEANUP_REINIT_LIVE, whichever fits best).
> Would control what happens to the global_live_at_{start,end} bitmaps 
> between iterations.

To make it specific I am attaching patch I was just testing before you
approved the other changes.  I noticed that toplev.c part is missing and
I can't redo it right now, but it merely moved the warning code four
lines up and added comment why.

Sat Feb  1 00:11:18 CET 2003  Jan Hubicka  <jh@suse.cz>

	* basic-block.h (PROP_ALLOW_CFG_CHANGES): Kill.
	(PROP_FINAL): Kill PROP_ALLOW_CFG_CHANGES.
	* flow.c (life_analysis): Kill PROP_ALLOW_CFG_CHANGES code
	* toplev.c (rest_of_compilation):  Do uninitialized warnings just after
	the life_analysis pass.  Add comment.

Index: gcc/basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.168
diff -c -3 -p -r1.168 basic-block.h
*** gcc/basic-block.h	24 Jan 2003 20:27:01 -0000	1.168
--- gcc/basic-block.h	31 Jan 2003 23:00:51 -0000
*************** enum update_life_extent
*** 470,484 ****
  #define PROP_REG_INFO		4	/* Update regs_ever_live et al.  */
  #define PROP_KILL_DEAD_CODE	8	/* Remove dead code.  */
  #define PROP_SCAN_DEAD_CODE	16	/* Scan for dead code.  */
- #define PROP_ALLOW_CFG_CHANGES	32	/* Allow the CFG to be changed
- 					   by dead code removal.  */
  #define PROP_AUTOINC		64	/* Create autoinc mem references.  */
  #define PROP_EQUAL_NOTES	128	/* Take into account REG_EQUAL notes.  */
  #define PROP_SCAN_DEAD_STORES	256	/* Scan for dead code.  */
  #define PROP_FINAL		(PROP_DEATH_NOTES | PROP_LOG_LINKS  \
  				 | PROP_REG_INFO | PROP_KILL_DEAD_CODE  \
  				 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
- 				 | PROP_ALLOW_CFG_CHANGES \
  				 | PROP_SCAN_DEAD_STORES)
  
  #define CLEANUP_EXPENSIVE	1	/* Do relativly expensive optimizations
--- 470,481 ----
Index: gcc/flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.548
diff -c -3 -p -r1.548 flow.c
*** gcc/flow.c	31 Jan 2003 06:52:48 -0000	1.548
--- gcc/flow.c	31 Jan 2003 23:00:52 -0000
*************** life_analysis (f, file, flags)
*** 444,450 ****
  #endif
  
    if (! optimize)
!     flags &= ~(PROP_LOG_LINKS | PROP_AUTOINC | PROP_ALLOW_CFG_CHANGES);
  
    /* The post-reload life analysis have (on a global basis) the same
       registers live as was computed by reload itself.  elimination
--- 444,450 ----
  #endif
  
    if (! optimize)
!     flags &= ~(PROP_LOG_LINKS | PROP_AUTOINC);
  
    /* The post-reload life analysis have (on a global basis) the same
       registers live as was computed by reload itself.  elimination
*************** update_life_info (blocks, extent, prop_f
*** 644,709 ****
    timevar_push ((extent == UPDATE_LIFE_LOCAL || blocks)
  		? TV_LIFE_UPDATE : TV_LIFE);
  
-   /* Changes to the CFG are only allowed when
-      doing a global update for the entire CFG.  */
-   if ((prop_flags & PROP_ALLOW_CFG_CHANGES)
-       && (extent == UPDATE_LIFE_LOCAL || blocks))
-     abort ();
- 
    /* For a global update, we go through the relaxation process again.  */
    if (extent != UPDATE_LIFE_LOCAL)
      {
!       for ( ; ; )
! 	{
! 	  int changed = 0;
! 
! 	  calculate_global_regs_live (blocks, blocks,
! 				prop_flags & (PROP_SCAN_DEAD_CODE
! 					      | PROP_SCAN_DEAD_STORES
! 					      | PROP_ALLOW_CFG_CHANGES));
! 
! 	  if ((prop_flags & (PROP_KILL_DEAD_CODE | PROP_ALLOW_CFG_CHANGES))
! 	      != (PROP_KILL_DEAD_CODE | PROP_ALLOW_CFG_CHANGES))
! 	    break;
! 
! 	  /* Removing dead code may allow the CFG to be simplified which
! 	     in turn may allow for further dead code detection / removal.  */
! 	  FOR_EACH_BB_REVERSE (bb)
! 	    {
! 	      COPY_REG_SET (tmp, bb->global_live_at_end);
! 	      changed |= propagate_block (bb, tmp, NULL, NULL,
! 				prop_flags & (PROP_SCAN_DEAD_CODE
! 					      | PROP_SCAN_DEAD_STORES
! 					      | PROP_KILL_DEAD_CODE));
! 	    }
! 
! 	  /* Don't pass PROP_SCAN_DEAD_CODE or PROP_KILL_DEAD_CODE to
! 	     subsequent propagate_block calls, since removing or acting as
! 	     removing dead code can affect global register liveness, which
! 	     is supposed to be finalized for this call after this loop.  */
! 	  stabilized_prop_flags
! 	    &= ~(PROP_SCAN_DEAD_CODE | PROP_SCAN_DEAD_STORES
! 		 | PROP_KILL_DEAD_CODE);
! 
! 	  if (! changed)
! 	    break;
! 
! 	  /* We repeat regardless of what cleanup_cfg says.  If there were
! 	     instructions deleted above, that might have been only a
! 	     partial improvement (see MAX_MEM_SET_LIST_LEN usage).
! 	     Further improvement may be possible.  */
! 	  cleanup_cfg (CLEANUP_EXPENSIVE);
! 
! 	  /* Zap the life information from the last round.  If we don't 
! 	     do this, we can wind up with registers that no longer appear
! 	     in the code being marked live at entry, which twiggs bogus
! 	     warnings from regno_uninitialized.  */
! 	  FOR_EACH_BB (bb)
! 	    {
! 	      CLEAR_REG_SET (bb->global_live_at_start);
! 	      CLEAR_REG_SET (bb->global_live_at_end);
! 	    }
! 	}
  
        /* If asked, remove notes from the blocks we'll update.  */
        if (extent == UPDATE_LIFE_GLOBAL_RM_NOTES)
--- 644,655 ----
    timevar_push ((extent == UPDATE_LIFE_LOCAL || blocks)
  		? TV_LIFE_UPDATE : TV_LIFE);
  
    /* For a global update, we go through the relaxation process again.  */
    if (extent != UPDATE_LIFE_LOCAL)
      {
!       calculate_global_regs_live (blocks, blocks,
! 			    prop_flags & (PROP_SCAN_DEAD_CODE
! 					  | PROP_SCAN_DEAD_STORES));
  
        /* If asked, remove notes from the blocks we'll update.  */
        if (extent == UPDATE_LIFE_GLOBAL_RM_NOTES)


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