From e7d536da91ad08a384cf1c3b66479fe88e8e3e15 Mon Sep 17 00:00:00 2001 From: kenner Date: Sun, 18 May 1997 12:39:57 +0000 Subject: [PATCH] (maybe_eliminate_biv_1): In (set (cc0) ) case, swap compare operands when mult_val < 0 in one additional place. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14087 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/loop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/loop.c b/gcc/loop.c index 64c1245977a..1c2cbc24161 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -6343,9 +6343,10 @@ maybe_eliminate_biv_1 (x, insn, bl, eliminate_p, where) emit_insn_before (gen_move_insn (tem, copy_rtx (v->add_val)), where); - if (validate_change (insn, &SET_SRC (PATTERN (insn)), - gen_rtx (COMPARE, VOIDmode, - v->new_reg, tem), 0)) + /* Substitute the new register for its invariant value in + the compare expression. */ + XEXP (new, (INTVAL (v->mult_val) < 0) ? 0 : 1) = tem; + if (validate_change (insn, &SET_SRC (PATTERN (insn)), new, 0)) return 1; } } -- 2.11.0