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]

Updated PATCH for expr.c problems (MIPS, 386), 1.1.2 and current


Here's an update to the patch in
<URL:http://egcs.cygnus.com/ml/egcs-patches/1999-02/msg00796.html>.
(It's close, but does not solve the problem you report in
<URL:http://egcs.cygnus.com/ml/egcs-bugs/1999-03/msg00973.html>.)

The force_operand is necessary since the address is often (as in
<URL:http://egcs.cygnus.com/ml/egcs-bugs/1999-02/msg00786.html>
and <URL:http://www.cygnus.com/ml/egcs-bugs/1998-Oct/0928.html>)
a (plus ...), which is not correct input for force_reg.  The ptr_mode
is because we're dealing with an address; there's no need to look inside
the source rtx for the mode.  That's also fatal when dealing with
addresses that are const_int:s...

This patch is against the 1.1.2 release, but should apply to the
current CVS.

Wed Mar 31 02:38:20 1999  Hans-Peter Nilsson  <hp@bitrange.com>

	* expr.c (expand_assignment): Filter XEXP(,0) of result of
	change_address through force_operand before calling
	force_reg.  Use ptr_mode in the force_reg call.
	(expand_expr): Ditto. 

cd ~/egcs/cvs_1.1/egcs/gcc/
/usr/bin/rsh localhost -l hp "(cd ~/egcs/cvs_1.1/egcs/gcc/; cvs diff expr.c)"
Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.84.2.7
diff -p -c -r1.84.2.7 expr.c
*** expr.c	1999/02/13 11:17:29	1.84.2.7
--- expr.c	1999/03/31 00:34:48
*************** expand_assignment (to, from, want_value,
*** 3151,3158 ****
  	        to_rtx = temp;
  	      else
  		to_rtx = change_address (to_rtx, mode1,
! 				         force_reg (GET_MODE (XEXP (temp, 0)),
! 						    XEXP (temp, 0)));
  	      bitpos = 0;
  	    }
  
--- 3151,3159 ----
  	        to_rtx = temp;
  	      else
  		to_rtx = change_address (to_rtx, mode1,
! 					 force_reg (ptr_mode,
! 						    force_operand (XEXP (temp, 0),
! 								   NULL_RTX)));
  	      bitpos = 0;
  	    }
  
*************** expand_expr (exp, target, tmode, modifie
*** 6210,6217 ****
  		  op0 = temp;
  		else
  		  op0 = change_address (op0, mode1,
! 					force_reg (GET_MODE (XEXP (temp, 0)),
! 						   XEXP (temp, 0)));
  		bitpos = 0;
  	      }
  
--- 6211,6219 ----
  		  op0 = temp;
  		else
  		  op0 = change_address (op0, mode1,
! 					force_reg (ptr_mode,
! 						   force_operand (XEXP (temp, 0),
! 								  NULL_RTX)));
  		bitpos = 0;
  	      }
  

brgds, H-P



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