using frame pointer + constant in reg_equiv_constant

Jim Wilson wilson@cygnus.com
Mon Nov 30 18:17:00 GMT 1998


	If you want to see this happen run the g77 testsuite on the x86 port.  Then
	change LEGITIMATE_CONSTANT_P to accept all constants.  Then rerun the testsuite
	and look for the regressions.

This is a reload bug.  It looks like Joern missed one case when he rewrote how
find_reloads substitutes changed operands back into the original insn.  A
patch follows.

If Joern agrees that this is right, then I will check it in.

With this patch, you should be able to revert your x86 LEGITIMATE_CONSTANT_P
change.  It might be useful to check which choice gives better code though,
and then document it in a comment.

1998-11-30  Jim Wilson  <wilson@cygnus.com>

	* reload.c (find_reloads): When force const to memory, put result
	in substed_operand not *recog_operand_loc.

Index: reload.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reload.c,v
retrieving revision 1.57
diff -p -r1.57 reload.c
*** reload.c	1998/11/18 17:52:45	1.57
--- reload.c	1998/12/01 01:46:33
*************** find_reloads (insn, replace, ind_levels,
*** 3586,3592 ****
  	    || no_input_reloads)
  	&& operand_mode[i] != VOIDmode)
        {
! 	*recog_operand_loc[i] = recog_operand[i]
  	  = find_reloads_toplev (force_const_mem (operand_mode[i],
  						  recog_operand[i]),
  				 i, address_type[i], ind_levels, 0, insn);
--- 3586,3592 ----
  	    || no_input_reloads)
  	&& operand_mode[i] != VOIDmode)
        {
! 	substed_operand[i] = recog_operand[i]
  	  = find_reloads_toplev (force_const_mem (operand_mode[i],
  						  recog_operand[i]),
  				 i, address_type[i], ind_levels, 0, insn);



More information about the Gcc-patches mailing list