aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-11-12 12:44:03 +0000
committerSteven Bosscher <stevenb@suse.de>2005-11-12 12:44:03 +0000
commit12f119405d8e8173d52b111e5ae192271043b749 (patch)
tree9d34f2ac0d8c915f4a5aa24a34fb365389310634
parent20d27953de89d8a8a78f49dc68275f15bc370d06 (diff)
* loop-invariant.c (may_assign_reg_p): Update to match with the
patch already commited to mainline. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/killloop-branch@106823 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.killloop5
-rw-r--r--gcc/loop-invariant.c39
2 files changed, 9 insertions, 35 deletions
diff --git a/gcc/ChangeLog.killloop b/gcc/ChangeLog.killloop
index 4f5331db31b..8dedb496f23 100644
--- a/gcc/ChangeLog.killloop
+++ b/gcc/ChangeLog.killloop
@@ -1,3 +1,8 @@
+2005-11-1 Steven Bosscher <stevenb@suse.de>
+
+ * loop-invariant.c (may_assign_reg_p): Update to match with the
+ patch already commited to mainline.
+
2005-11-07 Steven Bosscher <stevenb@suse.de>
* loop-invariant.c (may_assign_reg_p): Make absolutely sure that
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 1098c5b2001..cc855cea719 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -589,43 +589,15 @@ find_exits (struct loop *loop, basic_block *body,
LOOP_DATA (loop)->has_call = has_call;
}
-/* Test instruction to see if a hard_reg <- reg move exists. */
-static rtx test_insn;
-
/* Check whether we may assign a value to X from a register. */
static bool
may_assign_reg_p (rtx x)
{
- int insn_code;
- int num_clobbers = 0;
-
- /* If this is not a machine mode with a reg-reg move, we're finished. */
- if (!can_copy_p (GET_MODE (x)))
- return false;
-
- if (!HARD_REGISTER_P (x))
- return true;
-
- /* For hard registers, make sure that a reg-reg move for it exists by
- actually trying to recognize such an instruction. This is needed
- for i386's std and cld instructions, for example. */
-
- /* Initialize our test instruction if we haven't already. */
- if (!test_insn)
- {
- rtx fake_reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1);
- test_insn = make_insn_raw (gen_rtx_SET (VOIDmode, x, fake_reg));
- NEXT_INSN (test_insn) = PREV_INSN (test_insn) = 0;
- }
-
- /* Build an assignment to X and see if it can be recognized. */
- SET_DEST (PATTERN (test_insn)) = x;
- PUT_MODE (SET_SRC (PATTERN (test_insn)), GET_MODE (x));
- insn_code = recog (PATTERN (test_insn), test_insn, &num_clobbers);
- return (insn_code >= 0
- && (num_clobbers == 0
- || ! added_clobbers_hard_reg_p (insn_code)));
+ return (can_copy_p (GET_MODE (x))
+ && (!REG_P (x)
+ || !HARD_REGISTER_P (x)
+ || REGNO_REG_CLASS (REGNO (x)) != NO_REGS));
}
/* Finds definitions that may correspond to invariants in LOOP with body
@@ -1273,9 +1245,6 @@ move_loop_invariants (struct loops *loops)
df = df_init ();
- /* ??? Could GTY that insn, but I really don't think it's worth it. */
- test_insn = NULL;
-
/* Process the loops, innermost first. */
loop = loops->tree_root;
while (loop->inner)