alpha.c: Include rtl-iter.h.
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 27 Oct 2014 18:40:51 +0000 (18:40 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 27 Oct 2014 18:40:51 +0000 (18:40 +0000)
gcc/
* config/alpha/alpha.c: Include rtl-iter.h.
(split_small_symbolic_operand_1): Delete.
(split_small_symbolic_operand): Use FOR_EACH_SUBRTX_PTR.

From-SVN: r216754

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 534542caaf07ea8f24ee54afe34c2fd0411e4a54..4080aee2242e4e5a10df12e95fb3837064c8bafa 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-27  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/alpha/alpha.c: Include rtl-iter.h.
+       (split_small_symbolic_operand_1): Delete.
+       (split_small_symbolic_operand): Use FOR_EACH_SUBRTX_PTR.
+
 2014-10-27  Richard Sandiford  <richard.sandiford@arm.com>
 
        * config/s390/s390.c: Include rtl-iter.h.
index 1bead209be3f3b90da082609c4c380b1b4334e18..4d1263297eba0987247d42aff8f9a914f66a65f3 100644 (file)
@@ -88,6 +88,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "opts.h"
 #include "params.h"
 #include "builtins.h"
+#include "rtl-iter.h"
 
 /* Specify which cpu to schedule for.  */
 enum processor_type alpha_tune;
@@ -1244,30 +1245,24 @@ some_small_symbolic_operand_int (rtx *px, void *data ATTRIBUTE_UNUSED)
   return small_symbolic_operand (x, Pmode) != 0;
 }
 
-static int
-split_small_symbolic_operand_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
-{
-  rtx x = *px;
-
-  /* Don't re-split.  */
-  if (GET_CODE (x) == LO_SUM)
-    return -1;
-
-  if (small_symbolic_operand (x, Pmode))
-    {
-      x = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, x);
-      *px = x;
-      return -1;
-    }
-
-  return 0;
-}
-
 rtx
 split_small_symbolic_operand (rtx x)
 {
   x = copy_insn (x);
-  for_each_rtx (&x, split_small_symbolic_operand_1, NULL);
+  subrtx_ptr_iterator::array_type array;
+  FOR_EACH_SUBRTX_PTR (iter, array, &x, ALL)
+    {
+      rtx *ptr = *iter;
+      rtx x = *ptr;
+      /* Don't re-split.  */
+      if (GET_CODE (x) == LO_SUM)
+       iter.skip_subrtxes ();
+      else if (small_symbolic_operand (x, Pmode))
+       {
+         *ptr = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, x);
+         iter.skip_subrtxes ();
+       }
+    }
   return x;
 }