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: bootstrap failure with cvs current and --enable-checking


Hi

Here is a patch for alias.c which registers reg_base_value as a ggc_root.

Without this patch attempts to bootstrap on x86 with --enable-checking
and CFLAGS="-g0 -O3 -mcpu=pentiumpro -march=pentiumpro -funroll-loops" 
produce the failure reported by andreas.

Note without --enable-checking bootstraps complete with and without
this patch.

With this patch applied I can bootstrap with enable-checking after
applying a couple of patches to unroll.c to fix checking failures.

I deliberately haven't supplied change log entries for these because 
they are RFC.

Note bootstraping with --enable-checking is now painfully slow

Graham

*** alias.c.orig	Sat Oct 23 11:42:18 1999
--- alias.c	Sat Oct 23 11:43:24 1999
*************** Boston, MA 02111-1307, USA.  */
*** 25,30 ****
--- 25,31 ----
  #include "tree.h"
  #include "tm_p.h"
  #include "function.h"
+ #include "insn-flags.h"
  #include "expr.h"
  #include "regs.h"
  #include "hard-reg-set.h"
*************** Boston, MA 02111-1307, USA.  */
*** 32,38 ****
  #include "output.h"
  #include "toplev.h"
  #include "splay-tree.h"
! #include "insn-flags.h"
  
  /* The alias sets assigned to MEMs assist the back-end in determining
     which MEMs can alias which other MEMs.  In general, two MEMs in
--- 33,39 ----
  #include "output.h"
  #include "toplev.h"
  #include "splay-tree.h"
! #include "ggc.h"
  
  /* The alias sets assigned to MEMs assist the back-end in determining
     which MEMs can alias which other MEMs.  In general, two MEMs in
*************** static int nonlocal_reference_p         
*** 127,135 ****
     address.  The mode determines whether it is a function argument or
     other special value. */
  
! rtx *reg_base_value;
! rtx *new_reg_base_value;
! unsigned int reg_base_value_size;	/* size of reg_base_value array */
  #define REG_BASE_VALUE(X) \
    ((unsigned) REGNO (X) < reg_base_value_size ? reg_base_value[REGNO (X)] : 0)
  
--- 128,136 ----
     address.  The mode determines whether it is a function argument or
     other special value. */
  
! static rtx *reg_base_value;
! static rtx *new_reg_base_value;
! static unsigned int reg_base_value_size;	/* size of reg_base_value array */
  #define REG_BASE_VALUE(X) \
    ((unsigned) REGNO (X) < reg_base_value_size ? reg_base_value[REGNO (X)] : 0)
  
*************** static void
*** 449,455 ****
  record_set (dest, set)
       rtx dest, set;
  {
!   register int regno;
    rtx src;
  
    if (GET_CODE (dest) != REG)
--- 450,456 ----
  record_set (dest, set)
       rtx dest, set;
  {
!   register unsigned regno;
    rtx src;
  
    if (GET_CODE (dest) != REG)
*************** record_set (dest, set)
*** 457,462 ****
--- 458,466 ----
  
    regno = REGNO (dest);
  
+   if (regno >= reg_base_value_size)
+     abort ();
+ 
    if (set)
      {
        /* A CLOBBER wipes out any old value but does not prevent a previously
*************** init_alias_analysis ()
*** 1533,1542 ****
       optimization.  Loop unrolling can create a large number of
       registers.  */
    reg_base_value_size = maxreg * 2;
!   reg_base_value = (rtx *)oballoc (reg_base_value_size * sizeof (rtx));
    new_reg_base_value = (rtx *)alloca (reg_base_value_size * sizeof (rtx));
    reg_seen = (char *)alloca (reg_base_value_size);
-   bzero ((char *) reg_base_value, reg_base_value_size * sizeof (rtx));
    if (! reload_completed && flag_unroll_loops)
      {
        alias_invariant = (rtx *)xrealloc (alias_invariant,
--- 1540,1558 ----
       optimization.  Loop unrolling can create a large number of
       registers.  */
    reg_base_value_size = maxreg * 2;
!   if (ggc_p)
!     {
!       reg_base_value = (rtx *)xcalloc (reg_base_value_size, sizeof (rtx));
!       ggc_add_rtx_root (reg_base_value, reg_base_value_size);
!     }
!   else
!     {
!       reg_base_value = (rtx *)oballoc (reg_base_value_size * sizeof (rtx));
!       bzero ((char *) reg_base_value, reg_base_value_size * sizeof (rtx));
!     }
! 
    new_reg_base_value = (rtx *)alloca (reg_base_value_size * sizeof (rtx));
    reg_seen = (char *)alloca (reg_base_value_size);
    if (! reload_completed && flag_unroll_loops)
      {
        alias_invariant = (rtx *)xrealloc (alias_invariant,
*************** void
*** 1716,1722 ****
  end_alias_analysis ()
  {
    reg_known_value = 0;
!   reg_base_value = 0;
    reg_base_value_size = 0;
    if (alias_invariant)
      {
--- 1732,1747 ----
  end_alias_analysis ()
  {
    reg_known_value = 0;
!   reg_known_value_size = 0;
!   if (reg_base_value)
!     {
!       if (ggc_p)
! 	{
! 	  ggc_del_root (reg_base_value);
! 	  free ((char *)reg_base_value);
! 	}
!       reg_base_value = 0;
!     }
    reg_base_value_size = 0;
    if (alias_invariant)
      {


========================================================
Patch for unroll.c

*** unroll.c.old	Sun Oct 24 17:53:30 1999
--- unroll.c	Sat Oct 23 18:09:58 1999
*************** unroll_loop (loop_end, insn_count, loop_
*** 649,654 ****
--- 649,655 ----
  
    if (unroll_type == UNROLL_NAIVE
        && GET_CODE (last_loop_insn) == BARRIER
+       && GET_CODE (PREV_INSN (last_loop_insn)) == JUMP_INSN
        && start_label != JUMP_LABEL (PREV_INSN (last_loop_insn)))
      {
        /* In this case, we must copy the jump and barrier, because they will
*************** copy_loop_body (copy_start, copy_end, ma
*** 1961,1967 ****
  	  /* Make split induction variable constants `permanent' since we
  	     know there are no backward branches across iteration variable
  	     settings which would invalidate this.  */
! 	  if (dest_reg_was_split)
  	    {
  	      int regno = REGNO (SET_DEST (pattern));
  
--- 1962,1969 ----
  	  /* Make split induction variable constants `permanent' since we
  	     know there are no backward branches across iteration variable
  	     settings which would invalidate this.  */
! 	  if (dest_reg_was_split
!               && (GET_CODE (pattern) == SET || GET_CODE (pattern) == USE))
  	    {
  	      int regno = REGNO (SET_DEST (pattern));


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