From: Richard Sandiford Date: Mon, 27 Oct 2014 18:41:47 +0000 (+0000) Subject: i386.c (extended_reg_mentioned_1): Delete. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fc1e0c0a9ce41f7574d4e3e287dd27f9d74cb8a5;p=gcc.git i386.c (extended_reg_mentioned_1): Delete. gcc/ * config/i386/i386.c (extended_reg_mentioned_1): Delete. (x86_extended_reg_mentioned_p): Use FOR_EACH_SUBRTX. From-SVN: r216759 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a87dcea028..a0c8dec6d0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-27 Richard Sandiford + + * config/i386/i386.c (extended_reg_mentioned_1): Delete. + (x86_extended_reg_mentioned_p): Use FOR_EACH_SUBRTX. + 2014-10-27 Richard Sandiford * config/i386/i386.c: Include rtl-iter.h diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 57a2d07da8b..408fbd9cd54 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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