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]
Other format: [Raw text]

Fix pr23135.c on the Blackfin


This patch fixes
FAIL: gcc.c-torture/execute/pr23135.c compilation, -O2 (internal compiler error)
on the Blackfin.


We abort in delete_output_reload, in the loop that compares substed against the contents of reg_equiv_alt_mem_list. Code in reload.c is careful not to insert the normal MEM rtx for an equivalence into this list, but only forms that differ. However, it uses a pointer equality test, and parts of find_reloads_address can copy a MEM without modifying it further, which causes it to be put into the list erroneously.

Fixed by just using rtx_equal_p in all instances. Bootstrapped & regression tested on i686-linux; I've also verified that generated code is identical on a large set of input files. Committed as 123724.


Bernd -- This footer brought to you by insane German lawmakers. Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Registergericht Muenchen HRB 40368 Geschaeftsfuehrer Thomas Wessel, Vincent Roche, Joseph E. McDonough
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 123723)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-04-11  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* reload.c (find_reloads_toplev, find_reloads_address,
+	find_reloads_address_1, find_reloads_subreg_address): Use rtx_equal_p,
+	not a pointer equality test, to decide if we need to call
+	push_reg_equiv_alt_mem.
+
 2007-04-11  Sebastian Pop  <sebastian.pop@inria.fr>
 
 	* tree-data-ref.c (affine_function_zero_p, constant_access_functions,
Index: reload.c
===================================================================
--- reload.c	(revision 123723)
+++ reload.c	(working copy)
@@ -4570,7 +4570,7 @@ find_reloads_toplev (rtx x, int opnum, e
 	      x = mem;
 	      i = find_reloads_address (GET_MODE (x), &x, XEXP (x, 0), &XEXP (x, 0),
 					opnum, type, ind_levels, insn);
-	      if (x != mem)
+	      if (!rtx_equal_p (x, mem))
 		push_reg_equiv_alt_mem (regno, x);
 	      if (address_reloaded)
 		*address_reloaded = i;
@@ -4785,7 +4785,7 @@ find_reloads_address (enum machine_mode 
 		  find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
 					&XEXP (tem, 0), opnum,
 					ADDR_TYPE (type), ind_levels, insn);
-		  if (tem != orig)
+		  if (!rtx_equal_p (tem, orig))
 		    push_reg_equiv_alt_mem (regno, tem);
 		}
 	      /* We can avoid a reload if the register's equivalent memory
@@ -5589,7 +5589,7 @@ find_reloads_address_1 (enum machine_mod
 				      RELOAD_OTHER,
 				      ind_levels, insn);
 
-		if (tem != orig)
+		if (!rtx_equal_p (tem, orig))
 		  push_reg_equiv_alt_mem (regno, tem);
 
 		/* Then reload the memory location into a base
@@ -5656,7 +5656,7 @@ find_reloads_address_1 (enum machine_mod
 		  find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
 					&XEXP (tem, 0), opnum, type,
 					ind_levels, insn);
-		  if (tem != orig)
+		  if (!rtx_equal_p (tem, orig))
 		    push_reg_equiv_alt_mem (regno, tem);
 		  /* Put this inside a new increment-expression.  */
 		  x = gen_rtx_fmt_e (GET_CODE (x), GET_MODE (x), tem);
@@ -5811,7 +5811,7 @@ find_reloads_address_1 (enum machine_mod
 		find_reloads_address (GET_MODE (x), &x, XEXP (x, 0),
 				      &XEXP (x, 0), opnum, ADDR_TYPE (type),
 				      ind_levels, insn);
-		if (x != tem)
+		if (!rtx_equal_p (x, tem))
 		  push_reg_equiv_alt_mem (regno, x);
 	      }
 	  }
@@ -6037,7 +6037,7 @@ find_reloads_subreg_address (rtx x, int 
 				    &XEXP (tem, 0), opnum, type,
 				    ind_levels, insn);
 	      /* ??? Do we need to handle nonzero offsets somehow?  */
-	      if (!offset && tem != orig)
+	      if (!offset && !rtx_equal_p (tem, orig))
 		push_reg_equiv_alt_mem (regno, tem);
 
 	      /* If this is not a toplevel operand, find_reloads doesn't see

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