Patchwork Fix for postreload

login
register
mail settings
Submitter Chung-Lin Tang
Date Sept. 21, 2010, 4:19 p.m.
Message ID <4C98DB2F.2030008@codesourcery.com>
Download mbox | patch
Permalink /patch/65336/
State New
Headers show

Comments

Eric Botcazou - Sept. 21, 2010, 4:18 p.m.
> 	* postreload.c (move2add_note_store): Add reg_symbol_ref[]
> 	checks to update conditions. Fix reg_mode[] check.

OK, thanks.
Chung-Lin Tang - Sept. 21, 2010, 4:19 p.m.
Hi Eric, I agree with your points; here's the updated patch, again 
tested with same testsuite results.

	* postreload.c (move2add_note_store): Add reg_symbol_ref[]
	checks to update conditions. Fix reg_mode[] check.

Patch

Index: postreload.c
===================================================================
--- postreload.c	(revision 164472)
+++ postreload.c	(working copy)
@@ -2104,15 +2104,17 @@ 
 		       && (MODES_OK_FOR_MOVE2ADD
 			   (dst_mode, reg_mode[REGNO (XEXP (src, 1))])))
 		{
-		  if (reg_base_reg[REGNO (XEXP (src, 1))] < 0)
+		  if (reg_base_reg[REGNO (XEXP (src, 1))] < 0
+		      && reg_symbol_ref[REGNO (XEXP (src, 1))] == NULL_RTX)
 		    offset = reg_offset[REGNO (XEXP (src, 1))];
 		  /* Maybe the first register is known to be a
 		     constant.  */
 		  else if (reg_set_luid[REGNO (base_reg)]
 			   > move2add_last_label_luid
 			   && (MODES_OK_FOR_MOVE2ADD
-			       (dst_mode, reg_mode[REGNO (XEXP (src, 1))]))
-			   && reg_base_reg[REGNO (base_reg)] < 0)
+			       (dst_mode, reg_mode[REGNO (base_reg)]))
+			   && reg_base_reg[REGNO (base_reg)] < 0
+			   && reg_symbol_ref[REGNO (base_reg)] == NULL_RTX)
 		    {
 		      offset = reg_offset[REGNO (base_reg)];
 		      base_reg = XEXP (src, 1);