Patchwork Combine location with block using block_locations

login
register
mail settings
Submitter Dehao Chen
Date Sept. 20, 2012, 12:33 a.m.
Message ID <CAO2gOZXhZcqeynjaE=685RvhGghCHK0fDNQF+V_ujR1KimYK+g@mail.gmail.com>
Download mbox | patch
Permalink /patch/185271/
State New
Headers show

Comments

Dehao Chen - Sept. 20, 2012, 12:33 a.m.
The patch to fix this problem is attached. As I don't have machines
other than x86, I cannot test it. But this patch seemed
straightforward. I'll check it in in a couple of hours if no objection
is received.

Thanks,
Dehao

gcc/ChangeLog:

2012-09-19  Dehao Chen  <dehao@google.com>

	* config/s390/s390.c (s390_chunkify_start): Replacing INSN_LOCATOR.
	* config/spu/spu.c (emit_nop_for_insn): Likewise.
	(pad_bb): Likewise.
	(spu_emit_branch_hint): Likewise.
	(insert_hbrp_for_ilb_runout): Likewise.
	* config/mep/mep.c (mep_make_bundle): Likewise.
	(mep_bundle_insns): Likewise.
	* config/sh/sh.c (gen_block_redirect): Likewise.
	* config/c6x/c6x.c (gen_one_bundle): Likewise.
	* config/rs6000/rs6000.c (rs6000_final_prescan_insn): Likewise.
	* config/picochip/picochip.c (picochip_reorg): Likewise.
	* config/arm/arm.c (require_pic_register): Likewise.
	* config/mips/mips.c (mips16_gp_pseudo_reg): Likewise.
	* config/bfin/bfin.c (gen_one_bundle): Likewise.

Patch

Index: gcc/config/s390/s390.c
===================================================================
--- gcc/config/s390/s390.c	(revision 191494)
+++ gcc/config/s390/s390.c	(working copy)
@@ -6869,7 +6869,7 @@  s390_chunkify_start (void)
 		prev = prev_nonnote_insn (prev);
 	      if (prev)
 		jump = emit_jump_insn_after_setloc (gen_jump (label), insn,
-						    INSN_LOCATOR (prev));
+						    INSN_LOCATION (prev));
 	      else
 		jump = emit_jump_insn_after_noloc (gen_jump (label), insn);
 	      barrier = emit_barrier_after (jump);
Index: gcc/config/spu/spu.c
===================================================================
--- gcc/config/spu/spu.c	(revision 191494)
+++ gcc/config/spu/spu.c	(working copy)
@@ -1998,7 +1998,7 @@  emit_nop_for_insn (rtx insn)
   else
     new_insn = emit_insn_after (gen_lnop (), insn);
   recog_memoized (new_insn);
-  INSN_LOCATOR (new_insn) = INSN_LOCATOR (insn);
+  INSN_LOCATION (new_insn) = INSN_LOCATION (insn);
 }
 
 /* Insert nops in basic blocks to meet dual issue alignment
@@ -2037,7 +2037,7 @@  pad_bb(void)
 		  prev_insn = emit_insn_before (gen_lnop (), insn);
 		  PUT_MODE (prev_insn, GET_MODE (insn));
 		  PUT_MODE (insn, TImode);
-		  INSN_LOCATOR (prev_insn) = INSN_LOCATOR (insn);
+		  INSN_LOCATION (prev_insn) = INSN_LOCATION (insn);
 		  length += 4;
 		}
 	    }
@@ -2106,7 +2106,7 @@  spu_emit_branch_hint (rtx before, rtx branch, rtx
 
   hint = emit_insn_before (gen_hbr (branch_label, target), before);
   recog_memoized (hint);
-  INSN_LOCATOR (hint) = INSN_LOCATOR (branch);
+  INSN_LOCATION (hint) = INSN_LOCATION (branch);
   HINTED_P (branch) = 1;
 
   if (GET_CODE (target) == LABEL_REF)
@@ -2129,7 +2129,7 @@  spu_emit_branch_hint (rtx before, rtx branch, rtx
          which could make it too far for the branch offest to fit */
       insn = emit_insn_before (gen_blockage (), hint);
       recog_memoized (insn);
-      INSN_LOCATOR (insn) = INSN_LOCATOR (hint);
+      INSN_LOCATION (insn) = INSN_LOCATION (hint);
     }
   else if (distance <= 8 * 4)
     {
@@ -2141,20 +2141,20 @@  spu_emit_branch_hint (rtx before, rtx branch, rtx
 	  insn =
 	    emit_insn_after (gen_nopn_nv (gen_rtx_REG (SImode, 127)), hint);
 	  recog_memoized (insn);
-	  INSN_LOCATOR (insn) = INSN_LOCATOR (hint);
+	  INSN_LOCATION (insn) = INSN_LOCATION (hint);
 	}
 
       /* Make sure any nops inserted aren't scheduled before the hint. */
       insn = emit_insn_after (gen_blockage (), hint);
       recog_memoized (insn);
-      INSN_LOCATOR (insn) = INSN_LOCATOR (hint);
+      INSN_LOCATION (insn) = INSN_LOCATION (hint);
 
       /* Make sure any nops inserted aren't scheduled after the call. */
       if (CALL_P (branch) && distance < 8 * 4)
 	{
 	  insn = emit_insn_before (gen_blockage (), branch);
 	  recog_memoized (insn);
-	  INSN_LOCATOR (insn) = INSN_LOCATOR (branch);
+	  INSN_LOCATION (insn) = INSN_LOCATION (branch);
 	}
     }
 }
@@ -2340,7 +2340,7 @@  insert_hbrp_for_ilb_runout (rtx first)
 		insn =
 		  emit_insn_before (gen_iprefetch (GEN_INT (1)), before_4);
 		recog_memoized (insn);
-		INSN_LOCATOR (insn) = INSN_LOCATOR (before_4);
+		INSN_LOCATION (insn) = INSN_LOCATION (before_4);
 		INSN_ADDRESSES_NEW (insn,
 				    INSN_ADDRESSES (INSN_UID (before_4)));
 		PUT_MODE (insn, GET_MODE (before_4));
@@ -2349,7 +2349,7 @@  insert_hbrp_for_ilb_runout (rtx first)
 		  {
 		    insn = emit_insn_before (gen_lnop (), before_4);
 		    recog_memoized (insn);
-		    INSN_LOCATOR (insn) = INSN_LOCATOR (before_4);
+		    INSN_LOCATION (insn) = INSN_LOCATION (before_4);
 		    INSN_ADDRESSES_NEW (insn,
 					INSN_ADDRESSES (INSN_UID (before_4)));
 		    PUT_MODE (insn, TImode);
@@ -2361,7 +2361,7 @@  insert_hbrp_for_ilb_runout (rtx first)
 		insn =
 		  emit_insn_before (gen_iprefetch (GEN_INT (2)), before_16);
 		recog_memoized (insn);
-		INSN_LOCATOR (insn) = INSN_LOCATOR (before_16);
+		INSN_LOCATION (insn) = INSN_LOCATION (before_16);
 		INSN_ADDRESSES_NEW (insn,
 				    INSN_ADDRESSES (INSN_UID (before_16)));
 		PUT_MODE (insn, GET_MODE (before_16));
@@ -2370,7 +2370,7 @@  insert_hbrp_for_ilb_runout (rtx first)
 		  {
 		    insn = emit_insn_before (gen_lnop (), before_16);
 		    recog_memoized (insn);
-		    INSN_LOCATOR (insn) = INSN_LOCATOR (before_16);
+		    INSN_LOCATION (insn) = INSN_LOCATION (before_16);
 		    INSN_ADDRESSES_NEW (insn,
 					INSN_ADDRESSES (INSN_UID
 							(before_16)));
Index: gcc/config/mep/mep.c
===================================================================
--- gcc/config/mep/mep.c	(revision 191494)
+++ gcc/config/mep/mep.c	(working copy)
@@ -6814,9 +6814,9 @@  mep_make_bundle (rtx core, rtx cop)
   /* Derive a location for the bundle.  Individual instructions cannot
      have their own location because there can be no assembler labels
      between CORE and COP.  */
-  INSN_LOCATOR (insn) = INSN_LOCATOR (INSN_LOCATOR (core) ? core : cop);
-  INSN_LOCATOR (core) = 0;
-  INSN_LOCATOR (cop) = 0;
+  INSN_LOCATION (insn) = INSN_LOCATION (INSN_LOCATION (core) ? core : cop);
+  INSN_LOCATION (core) = 0;
+  INSN_LOCATION (cop) = 0;
 
   return insn;
 }
@@ -6913,7 +6913,7 @@  mep_bundle_insns (rtx insns)
 	     whenever the current line changes, set the location info
 	     for INSN to match FIRST.  */
 
-	  INSN_LOCATOR (insn) = INSN_LOCATOR (first);
+	  INSN_LOCATION (insn) = INSN_LOCATION (first);
 
 	  note = PREV_INSN (insn);
 	  while (note && note != first)
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 191494)
+++ gcc/config/sh/sh.c	(working copy)
@@ -5530,7 +5530,7 @@  gen_block_redirect (rtx jump, int addr, int need_b
 	 NOTE_INSN_BLOCK_END notes between the indirect_jump_scratch and
 	 the jump.  */
 
-      INSN_LOCATOR (insn) = INSN_LOCATOR (jump);
+      INSN_LOCATION (insn) = INSN_LOCATION (jump);
       INSN_CODE (insn) = CODE_FOR_indirect_jump_scratch;
       return insn;
     }
Index: gcc/config/c6x/c6x.c
===================================================================
--- gcc/config/c6x/c6x.c	(revision 191494)
+++ gcc/config/c6x/c6x.c	(working copy)
@@ -4595,7 +4595,7 @@  gen_one_bundle (rtx *slot, int n_filled, int real_
   bundle = gen_rtx_SEQUENCE (VOIDmode, gen_rtvec_v (n_filled, slot));
   bundle = make_insn_raw (bundle);
   BLOCK_FOR_INSN (bundle) = BLOCK_FOR_INSN (slot[0]);
-  INSN_LOCATOR (bundle) = INSN_LOCATOR (slot[0]);
+  INSN_LOCATION (bundle) = INSN_LOCATION (slot[0]);
   PREV_INSN (bundle) = PREV_INSN (slot[real_first]);
 
   t = NULL_RTX;
@@ -4609,7 +4609,7 @@  gen_one_bundle (rtx *slot, int n_filled, int real_
 	NEXT_INSN (t) = insn;
       t = insn;
       if (i > 0)
-	INSN_LOCATOR (slot[i]) = INSN_LOCATOR (bundle);
+	INSN_LOCATION (slot[i]) = INSN_LOCATION (bundle);
     }
 
   NEXT_INSN (bundle) = NEXT_INSN (PREV_INSN (bundle));
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 191494)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -27351,7 +27351,7 @@  rs6000_final_prescan_insn (rtx insn, rtx *operand
     {
       const char *temp;
       int insn_code_number = recog_memoized (insn);
-      location_t location = locator_location (INSN_LOCATOR (insn));
+      location_t location = INSN_LOCATION (insn);
 
       /* Punt on insns we cannot recognize.  */
       if (insn_code_number < 0)
Index: gcc/config/picochip/picochip.c
===================================================================
--- gcc/config/picochip/picochip.c	(revision 191494)
+++ gcc/config/picochip/picochip.c	(working copy)
@@ -3298,16 +3298,16 @@  picochip_reorg (void)
               if (GET_MODE (insn) == TImode)
               {
                 vliw_start = insn;
-                vliw_insn_location = INSN_LOCATOR (insn);
+                vliw_insn_location = INSN_LOCATION (insn);
               }
               if (JUMP_P (insn) || CALL_P(insn))
               {
-                vliw_insn_location = INSN_LOCATOR (insn);
+                vliw_insn_location = INSN_LOCATION (insn);
                 for (insn1 = vliw_start; insn1 != insn ; insn1 = next_real_insn (insn1))
-                  INSN_LOCATOR (insn1) = vliw_insn_location;
+                  INSN_LOCATION (insn1) = vliw_insn_location;
               }
               /* Tag subsequent instructions with the same location. */
-              INSN_LOCATOR (insn) = vliw_insn_location;
+              INSN_LOCATION (insn) = vliw_insn_location;
 	    }
 	}
 
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 191494)
+++ gcc/config/arm/arm.c	(working copy)
@@ -5359,7 +5359,7 @@  require_pic_register (void)
 
 	      for (insn = seq; insn; insn = NEXT_INSN (insn))
 		if (INSN_P (insn))
-		  INSN_LOCATOR (insn) = prologue_locator;
+		  INSN_LOCATION (insn) = prologue_location;
 
 	      /* We can be called during expansion of PHI nodes, where
 	         we can't yet emit instructions directly in the final
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	(revision 191494)
+++ gcc/config/mips/mips.c	(working copy)
@@ -2628,7 +2628,7 @@  mips16_gp_pseudo_reg (void)
 
       insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
       insn = emit_insn_after (insn, scan);
-      INSN_LOCATOR (insn) = 0;
+      INSN_LOCATION (insn) = 0;
 
       pop_topmost_sequence ();
     }
Index: gcc/config/bfin/bfin.c
===================================================================
--- gcc/config/bfin/bfin.c	(revision 191494)
+++ gcc/config/bfin/bfin.c	(working copy)
@@ -3918,12 +3918,12 @@  gen_one_bundle (rtx slot[3])
     }
 
   /* Avoid line number information being printed inside one bundle.  */
-  if (INSN_LOCATOR (slot[1])
-      && INSN_LOCATOR (slot[1]) != INSN_LOCATOR (slot[0]))
-    INSN_LOCATOR (slot[1]) = INSN_LOCATOR (slot[0]);
-  if (INSN_LOCATOR (slot[2])
-      && INSN_LOCATOR (slot[2]) != INSN_LOCATOR (slot[0]))
-    INSN_LOCATOR (slot[2]) = INSN_LOCATOR (slot[0]);
+  if (INSN_LOCATION (slot[1])
+      && INSN_LOCATION (slot[1]) != INSN_LOCATION (slot[0]))
+    INSN_LOCATION (slot[1]) = INSN_LOCATION (slot[0]);
+  if (INSN_LOCATION (slot[2])
+      && INSN_LOCATION (slot[2]) != INSN_LOCATION (slot[0]))
+    INSN_LOCATION (slot[2]) = INSN_LOCATION (slot[0]);
 
   /* Terminate them with "|| " instead of ";" in the output.  */
   PUT_MODE (slot[0], SImode);