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]

Test reference to reg_renumber in eliminate_regs


dwarf2out.c calls elminate_regs and it can get called for the abstract
occurrence of an inlined function.  In that case, reg_renumber may have
been zero, so it needs to be tested first.  The test case is compiling
osint.adb from GNAT on SGI MIPS.

Installed as obviously correct.

Mon Oct 29 19:22:07 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* reload1.c (eliminate_regs): Test for reg_renumber being allocated
	before referencing it.

*** reload1.c	2001/10/28 12:42:05	1.307
--- reload1.c	2001/10/29 23:47:22
*************** eliminate_regs (x, mem_mode, insn)
*** 2299,2304 ****
  
  	}
!       else if (reg_renumber[regno] < 0 && reg_equiv_constant
! 	       && reg_equiv_constant[regno]
  	       && ! CONSTANT_P (reg_equiv_constant[regno]))
  	return eliminate_regs (copy_rtx (reg_equiv_constant[regno]),
--- 2299,2304 ----
  
  	}
!       else if (reg_renumber && reg_renumber[regno] < 0
! 	       && reg_equiv_constant && reg_equiv_constant[regno]
  	       && ! CONSTANT_P (reg_equiv_constant[regno]))
  	return eliminate_regs (copy_rtx (reg_equiv_constant[regno]),
*************** eliminate_regs (x, mem_mode, insn)
*** 2366,2370 ****
  	rtx new1 = eliminate_regs (XEXP (x, 1), mem_mode, insn);
  
! 	if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1))
  	  {
  	    /* If one side is a PLUS and the other side is a pseudo that
--- 2366,2370 ----
  	rtx new1 = eliminate_regs (XEXP (x, 1), mem_mode, insn);
  
! 	if (reg_renumber && (new0 != XEXP (x, 0) || new1 != XEXP (x, 1)))
  	  {
  	    /* If one side is a PLUS and the other side is a pseudo that
*************** eliminate_regs (x, mem_mode, insn)
*** 2474,2478 ****
  	  new = eliminate_regs (XEXP (x, 1), mem_mode, insn);
  	  if (new != XEXP (x, 1))
! 	    return gen_rtx_fmt_ee (GET_CODE (x), GET_MODE (x), XEXP (x, 0), new);
  	}
        return x;
--- 2474,2479 ----
  	  new = eliminate_regs (XEXP (x, 1), mem_mode, insn);
  	  if (new != XEXP (x, 1))
! 	    return
! 	      gen_rtx_fmt_ee (GET_CODE (x), GET_MODE (x), XEXP (x, 0), new);
  	}
        return x;


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