diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1995-05-14 12:44:30 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1995-05-14 12:44:30 -0700 |
commit | ba68fc32bc83b21b54c7d9106bc7f0e81f07f1b1 (patch) | |
tree | 15e53cc7b99e9621a28bd37f008fc0f939bd6470 /gcc | |
parent | 0ad228e65480a901584dd3460fe388be00cfb29d (diff) | |
download | gcc-ba68fc32bc83b21b54c7d9106bc7f0e81f07f1b1.zip gcc-ba68fc32bc83b21b54c7d9106bc7f0e81f07f1b1.tar.gz gcc-ba68fc32bc83b21b54c7d9106bc7f0e81f07f1b1.tar.bz2 |
(unroll_loop): Make local_regno have size max_reg_before_loop.
(unroll_loop): Make local_regno have size
max_reg_before_loop. Don't do local register optimization if
copy_end has no INSN_LUID.
From-SVN: r9684
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/unroll.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c index 400b43b..161cdd2 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -718,11 +718,15 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, addr_combined_regs = (struct induction **) alloca (maxregnum * sizeof (struct induction *)); bzero ((char *) addr_combined_regs, maxregnum * sizeof (struct induction *)); - local_regno = (char *) alloca (maxregnum); - bzero (local_regno, maxregnum); + /* We must limit it to max_reg_before_loop, because only these pseudo + registers have valid regno_first_uid info. Any register created after + that is unlikely to be local to the loop anyways. */ + local_regno = (char *) alloca (max_reg_before_loop); + bzero (local_regno, max_reg_before_loop); /* Mark all local registers, i.e. the ones which are referenced only - inside the loop. */ + inside the loop. */ + if (INSN_UID (copy_end) < max_uid_for_loop) { int copy_start_luid = INSN_LUID (copy_start); int copy_end_luid = INSN_LUID (copy_end); @@ -732,7 +736,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, if (GET_CODE (copy_end) == JUMP_INSN) copy_end_luid--; - for (j = FIRST_PSEUDO_REGISTER; j < maxregnum; ++j) + for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; ++j) 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 @@ -951,7 +955,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, if (local_label[j]) map->label_map[j] = gen_label_rtx (); - for (j = FIRST_PSEUDO_REGISTER; j < maxregnum; j++) + for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; j++) if (local_regno[j]) map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j])); @@ -1092,7 +1096,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, if (local_label[j]) map->label_map[j] = gen_label_rtx (); - for (j = FIRST_PSEUDO_REGISTER; j < maxregnum; j++) + for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; j++) if (local_regno[j]) map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j])); |