[31/50] lower-subreg.c:resolve_debug
diff mbox

Message ID 878un58xrd.fsf@googlemail.com
State New
Headers show

Commit Message

Richard Sandiford Aug. 3, 2014, 2:15 p.m. UTC
gcc/
	* lower-subreg.c (adjust_decomposed_uses): Delete.
	(resolve_debug): Use FOR_EACH_SUBRTX_PTR rather than for_each_rtx.
	Remove handling of null rtxes.

Comments

Jeff Law Aug. 5, 2014, 9:13 p.m. UTC | #1
On 08/03/14 08:15, Richard Sandiford wrote:
> gcc/
> 	* lower-subreg.c (adjust_decomposed_uses): Delete.
> 	(resolve_debug): Use FOR_EACH_SUBRTX_PTR rather than for_each_rtx.
> 	Remove handling of null rtxes.
OK.
jeff

Patch
diff mbox

Index: gcc/lower-subreg.c
===================================================================
--- gcc/lower-subreg.c	2014-08-03 11:25:28.502137966 +0100
+++ gcc/lower-subreg.c	2014-08-03 11:25:28.779140704 +0100
@@ -765,34 +765,6 @@  resolve_subreg_use (rtx *loc, rtx insn)
   return false;
 }
 
-/* This is called via for_each_rtx.  Look for SUBREGs which can be
-   decomposed and decomposed REGs that need copying.  */
-
-static int
-adjust_decomposed_uses (rtx *px, void *data ATTRIBUTE_UNUSED)
-{
-  rtx x = *px;
-
-  if (x == NULL_RTX)
-    return 0;
-
-  if (resolve_subreg_p (x))
-    {
-      x = simplify_subreg_concatn (GET_MODE (x), SUBREG_REG (x),
-				   SUBREG_BYTE (x));
-
-      if (x)
-	*px = x;
-      else
-	x = copy_rtx (*px);
-    }
-
-  if (resolve_reg_p (x))
-    *px = copy_rtx (x);
-
-  return 0;
-}
-
 /* Resolve any decomposed registers which appear in register notes on
    INSN.  */
 
@@ -1164,7 +1136,24 @@  resolve_use (rtx pat, rtx insn)
 static void
 resolve_debug (rtx insn)
 {
-  for_each_rtx (&PATTERN (insn), adjust_decomposed_uses, NULL_RTX);
+  subrtx_ptr_iterator::array_type array;
+  FOR_EACH_SUBRTX_PTR (iter, array, &PATTERN (insn), NONCONST)
+    {
+      rtx *loc = *iter;
+      rtx x = *loc;
+      if (resolve_subreg_p (x))
+	{
+	  x = simplify_subreg_concatn (GET_MODE (x), SUBREG_REG (x),
+				       SUBREG_BYTE (x));
+
+	  if (x)
+	    *loc = x;
+	  else
+	    x = copy_rtx (*loc);
+	}
+      if (resolve_reg_p (x))
+	*loc = copy_rtx (x);
+    }
 
   df_insn_rescan (insn);