aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-05-12 12:48:07 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-05-12 12:48:07 -0400
commitb5f89788219bb69aa9d4c37b3673f96c4eb339a7 (patch)
tree238ec9f0a4993c31c984d43d69b1f084433d735e /gcc
parent454e0249676efa5688841900b0447fe690fb8742 (diff)
downloadgcc-b5f89788219bb69aa9d4c37b3673f96c4eb339a7.zip
gcc-b5f89788219bb69aa9d4c37b3673f96c4eb339a7.tar.gz
gcc-b5f89788219bb69aa9d4c37b3673f96c4eb339a7.tar.bz2
(unroll_loop): Don't move reg if used in copy_end and that is a
JUMP_INSN. From-SVN: r9646
Diffstat (limited to 'gcc')
-rw-r--r--gcc/unroll.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 84a79ce..050273f 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -728,17 +728,17 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
int copy_start_luid = INSN_LUID (copy_start);
int copy_end_luid = INSN_LUID (copy_end);
+ /* If a register is used in the jump insn, we must not duplicate it
+ since it will also be used outside the loop. */
+ if (GET_CODE (copy_end) == JUMP_INSN)
+ copy_end_luid--;
+
for (j = FIRST_PSEUDO_REGISTER; j < maxregnum; ++j)
- {
- int first_uid = regno_first_uid[j];
- int last_uid = regno_last_uid[j];
-
- if (first_uid > 0 && first_uid <= max_uid_for_loop
- && uid_luid[first_uid] >= copy_start_luid
- && last_uid > 0 && last_uid <= max_uid_for_loop
- && uid_luid[last_uid] <= copy_end_luid)
- local_regno[j] = 1;
- }
+ if (regno_first_uid[j] > 0 && regno_first_uid[j] <= max_uid_for_loop
+ && uid_luid[regno_first_uid[j]] >= copy_start_luid
+ && regno_last_uid[j] > 0 && regno_last_uid[j] <= max_uid_for_loop
+ && uid_luid[regno_last_uid[j]] <= copy_end_luid)
+ local_regno[j] = 1;
}
/* If this loop requires exit tests when unrolled, check to see if we