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

Re: ia64 bootstrap failure with the reload-branch


(slowly catching up with vacation backlog)

James E Wilson wrote:

Reload is using registers without setting regs_ever_live. The IA-64 prologue code needs a temp register to save/restore b0, and it uses regs_ever_live to find one. Also, because we have variable size register windows, we need the regs_ever_live info to be accurate so we can set up the register windows properly.

The problem happens in inherit_one_chain, but it looks like there are other similar places that may have the same problem. Ugly patch attached that gets me past this problem. We should probably get Bernd's opinion on how he thinks this should be fixed.

Thanks for debugging this. The patch isn't quite right, because setting additional bits in regs_ever_live may need to cause additional iterations of calculate_needs_all_insns.


Try the patch below - does it fix the problem?


Bernd
	* reload1.c (find_optional_reg, inherit_one_chain): Always use
	set_reload_reg to assign a register to a reload.

Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.463.2.3
diff -c -p -r1.463.2.3 reload1.c
*** reload1.c	7 Apr 2005 11:21:35 -0000	1.463.2.3
--- reload1.c	7 Apr 2005 11:30:48 -0000
*************** static HARD_REG_SET *pseudo_previous_reg
*** 149,155 ****
  static HARD_REG_SET *pseudo_forbidden_regs;
  
  /* All hard regs that have been used as spill registers for any insn are
!    marked in this set.  */
  static HARD_REG_SET used_spill_regs;
  
  /* Nonzero if indirect addressing is supported on the machine; this means
--- 149,156 ----
  static HARD_REG_SET *pseudo_forbidden_regs;
  
  /* All hard regs that have been used as spill registers for any insn are
!    marked in this set.  This is used to update regs_ever_live in
!    finish_spills.  */
  static HARD_REG_SET used_spill_regs;
  
  /* Nonzero if indirect addressing is supported on the machine; this means
*************** find_optional_reg (struct reload *rl, HA
*** 2916,2926 ****
        if (i == nregs)
  	{
  	  if (do_allocate)
! 	    {
! 	      rl->nregs = nregs;
! 	      rl->reginfo.regno = suggested;
! 	      rl->reginfo.allocated = 1;
! 	    }
  	  return 1;
  	}
      }
--- 2917,2923 ----
        if (i == nregs)
  	{
  	  if (do_allocate)
! 	    set_reload_reg (rl, suggested);
  	  return 1;
  	}
      }
*************** find_optional_reg (struct reload *rl, HA
*** 2945,2955 ****
      return 0;
  
    if (do_allocate)
!     {
!       rl->nregs = HARD_REGNO_NREGS (best_reg, rl->mode);
!       rl->reginfo.regno = best_reg;
!       rl->reginfo.allocated = 1;
!     }
    return 1;
  }
  
--- 2942,2949 ----
      return 0;
  
    if (do_allocate)
!     set_reload_reg (rl, best_reg);
! 
    return 1;
  }
  
*************** inherit_one_chain (struct inherit_chain 
*** 3656,3664 ****
       as above.  */
  
    /* Change the head reload to use the inheritance register.  */
!   head_rl->nregs = HARD_REGNO_NREGS (best_reg, head_rl->mode);
!   head_rl->reginfo.regno = best_reg;
!   head_rl->reginfo.allocated = 1;
  
    /* Extend lifetime of original reload.  Set the LIVE_UNTIL_END flag so
       that following calls to compute_birth_death will preserve this
--- 3650,3656 ----
       as above.  */
  
    /* Change the head reload to use the inheritance register.  */
!   set_reload_reg (head_rl, best_reg);
  
    /* Extend lifetime of original reload.  Set the LIVE_UNTIL_END flag so
       that following calls to compute_birth_death will preserve this

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