summaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-28 06:23:31 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-28 06:23:31 +0000
commitaf679a57d56d50071e05117485e268ba25f50147 (patch)
tree54e24e1a5cb26adeb588b0d95b7e29cc7728a711 /gcc/ira.c
parente32f8fb9b9c5db289e580f5d4eb4729837d6f0f1 (diff)
downloadgcc-af679a57d56d50071e05117485e268ba25f50147.tar.gz
gcc/
* ira.c: Include rtl-iter.h. (set_paradoxical_subreg): Turn from being a for_each_rtx callback to being a function that examines each subrtx itself. Remove handling of null rtxes. (update_equiv_regs): Update call accordingly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214642 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 7c184961d91..d499d7de7b4 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -392,6 +392,7 @@ along with GCC; see the file COPYING3. If not see
#include "lra.h"
#include "dce.h"
#include "dbgcnt.h"
+#include "rtl-iter.h"
struct target_ira default_target_ira;
struct target_ira_int default_target_ira_int;
@@ -3266,23 +3267,20 @@ no_equiv (rtx reg, const_rtx store ATTRIBUTE_UNUSED,
/* Check whether the SUBREG is a paradoxical subreg and set the result
in PDX_SUBREGS. */
-static int
-set_paradoxical_subreg (rtx *subreg, void *pdx_subregs)
+static void
+set_paradoxical_subreg (rtx_insn *insn, bool *pdx_subregs)
{
- rtx reg;
-
- if ((*subreg) == NULL_RTX)
- return 1;
- if (GET_CODE (*subreg) != SUBREG)
- return 0;
- reg = SUBREG_REG (*subreg);
- if (!REG_P (reg))
- return 0;
-
- if (paradoxical_subreg_p (*subreg))
- ((bool *)pdx_subregs)[REGNO (reg)] = true;
-
- return 0;
+ subrtx_iterator::array_type array;
+ FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST)
+ {
+ const_rtx subreg = *iter;
+ if (GET_CODE (subreg) == SUBREG)
+ {
+ const_rtx reg = SUBREG_REG (subreg);
+ if (REG_P (reg) && paradoxical_subreg_p (subreg))
+ pdx_subregs[REGNO (reg)] = true;
+ }
+ }
}
/* In DEBUG_INSN location adjust REGs from CLEARED_REGS bitmap to the
@@ -3345,8 +3343,7 @@ update_equiv_regs (void)
FOR_EACH_BB_FN (bb, cfun)
FOR_BB_INSNS (bb, insn)
if (NONDEBUG_INSN_P (insn))
- for_each_rtx_in_insn (&insn, set_paradoxical_subreg,
- (void *) pdx_subregs);
+ set_paradoxical_subreg (insn, pdx_subregs);
/* Scan the insns and find which registers have equivalences. Do this
in a separate scan of the insns because (due to -fcse-follow-jumps)