This is the mail archive of the gcc-bugs@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]

Egcs 1.1.1 reloading bug on ARM


The ARM md contains patterns for the multiply instructions which tie an 
input to an early clobber output (because that particular input is not 
earlyclobbered).  However, if both the inputs and the outputs are spilled 
then choose_reload_regs can assign the inputs via inherited reloads that 
ignore the earlyclobber constraints.  The patch below fixes the problem by 
forcing a copy of the inherited reload to be made for a tied input in 
these circumstances.

While the testcase at the end only exposes the problem for egcs-1.1.1 for 
the arm-aout configuration (compiling with -O2), examination of the trunk 
code shows that this could also happen there (though the better reload 
handling means that the current example doesn't fail).  Is the fix below 
ok to install?

Tue Jan 12 19:52:19 1999  Richard Earnshaw (rearnsha@arm.com)

	reload1.c (choose_reload_regs):  Make a copy of an inherited a 
	reload if the input is tied to an earlyclobber operand.


Index: reload1.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reload1.c,v
retrieving revision 1.56.2.2
diff -p -r1.56.2.2 reload1.c
*** reload1.c	1998/08/27 22:48:14	1.56.2.2
--- reload1.c	1999/01/12 19:49:04
*************** choose_reload_regs (insn, avoid_return_r
*** 5721,5727 ****
  			  for (i1 = 0; i1 < n_earlyclobbers; i1++)
  			    if (reg_overlap_mentioned_for_reload_p
  				(reg_last_reload_reg[regno],
! 				 reload_earlyclobbers[i1]))
  			      break;
  
  			  if (i1 != n_earlyclobbers
--- 5721,5738 ----
  			  for (i1 = 0; i1 < n_earlyclobbers; i1++)
  			    if (reg_overlap_mentioned_for_reload_p
  				(reg_last_reload_reg[regno],
! 				 reload_earlyclobbers[i1])
! 				/* If this reload is an input tied to
! 				   an earlyclobber output and there
! 				   are other reloads for this insn,
! 				   then inheriting this reload might
! 				   clobber other reloaded inputs.
! 				   Detecting this while scanning the
! 				   other reloads is hard, so don't
! 				   inherit the reload in this rare
! 				   case. */
! 				|| (reload_earlyclobbers[i1] == reload_out[r]
! 				    && n_reloads > 1))
  			      break;
  
  			  if (i1 != n_earlyclobbers

foo2.i.gz


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