[patch] Fix bootstrap

Richard Henderson rth@redhat.com
Fri Jan 31 06:55:00 GMT 2003


On Thu, Jan 30, 2003 at 02:37:46PM -0800, Richard Henderson wrote:
> It seems specific to EV4, when there is no single-byte load insn.

Incidentally, we're producing two loads from memory, adjacent,
which just makes more work for the rest of the compiler.  This
seems silly.  Addressed like so.


r~



        * expr.c (store_expr): Promote all MEM intermediates to regs.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.503
diff -c -p -d -u -r1.503 expr.c
--- expr.c	26 Jan 2003 09:09:23 -0000	1.503
+++ expr.c	31 Jan 2003 06:45:38 -0000
@@ -4398,12 +4398,12 @@ store_expr (exp, target, want_value)
 
       temp = expand_expr (exp, inner_target, VOIDmode, 0);
 
-      /* If TEMP is a volatile MEM and we want a result value, make
-	 the access now so it gets done only once.  Likewise if
-	 it contains TARGET.  */
-      if (GET_CODE (temp) == MEM && want_value
-	  && (MEM_VOLATILE_P (temp)
-	      || reg_mentioned_p (SUBREG_REG (target), XEXP (temp, 0))))
+      /* If TEMP is a MEM and we want a result value, make the access
+	 now so it gets done only once.  Strictly speaking, this is 
+	 only necessary if the MEM is volatile, or if the address 
+	 overlaps TARGET.  But not performing the load twice also
+	 reduces the amount of rtl we generate and then have to CSE.  */
+      if (GET_CODE (temp) == MEM && want_value)
 	temp = copy_to_reg (temp);
 
       /* If TEMP is a VOIDmode constant, use convert_modes to make



More information about the Gcc-patches mailing list