gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Oct 2014 18:41:47 +0000 (18:41 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Oct 2014 18:41:47 +0000 (18:41 +0000)
* config/i386/i386.c (extended_reg_mentioned_1): Delete.
(x86_extended_reg_mentioned_p): Use FOR_EACH_SUBRTX.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216759 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c

index 7a87dce..a0c8dec 100644 (file)
@@ -1,5 +1,10 @@
 2014-10-27  Richard Sandiford  <richard.sandiford@arm.com>
 
+       * config/i386/i386.c (extended_reg_mentioned_1): Delete.
+       (x86_extended_reg_mentioned_p): Use FOR_EACH_SUBRTX.
+
+2014-10-27  Richard Sandiford  <richard.sandiford@arm.com>
+
        * config/i386/i386.c: Include rtl-iter.h
        (ix86_check_avx256_register): Take a const_rtx and return a bool.
        (ix86_check_avx256_stores): Update call accordingly.
index 57a2d07..408fbd9 100644 (file)
@@ -39695,25 +39695,20 @@ x86_extended_QIreg_mentioned_p (rtx_insn *insn)
   return false;
 }
 
-/* Return nonzero when P points to register encoded via REX prefix.
-   Called via for_each_rtx.  */
-static int
-extended_reg_mentioned_1 (rtx *p, void *)
-{
-   unsigned int regno;
-   if (!REG_P (*p))
-     return 0;
-   regno = REGNO (*p);
-   return REX_INT_REGNO_P (regno) || REX_SSE_REGNO_P (regno);
-}
-
 /* Return true when INSN mentions register that must be encoded using REX
    prefix.  */
 bool
 x86_extended_reg_mentioned_p (rtx insn)
 {
-  return for_each_rtx (INSN_P (insn) ? &PATTERN (insn) : &insn,
-                      extended_reg_mentioned_1, NULL);
+  subrtx_iterator::array_type array;
+  FOR_EACH_SUBRTX (iter, array, INSN_P (insn) ? PATTERN (insn) : insn, NONCONST)
+    {
+      const_rtx x = *iter;
+      if (REG_P (x)
+         && (REX_INT_REGNO_P (REGNO (x)) || REX_SSE_REGNO_P (REGNO (x))))
+       return true;
+    }
+  return false;
 }
 
 /* If profitable, negate (without causing overflow) integer constant