diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-01 19:00:52 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-01 19:00:52 +0000 |
commit | 3e0562870dbda8443054c1df7ec6ee24ac8b73fd (patch) | |
tree | 6c5b09b31e6a4d39b4498c5e90c9b043bfa812a7 /gcc/regmove.c | |
parent | fcdd68890f6ea78cd21e10f09ca499acf9de4059 (diff) | |
download | gcc-3e0562870dbda8443054c1df7ec6ee24ac8b73fd.tar.gz |
* regmove.c (regmove_optimize): Add variable old_max_uid.
At the end of the function, update basic_block_end.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22724 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r-- | gcc/regmove.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c index 7f94be4ff89..41235f13704 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -917,6 +917,7 @@ regmove_optimize (f, nregs, regmove_dump_file) int nregs; FILE *regmove_dump_file; { + int old_max_uid = get_max_uid (); rtx insn; struct match match; int pass; @@ -926,8 +927,8 @@ regmove_optimize (f, nregs, regmove_dump_file) regno_src_regno = (int *)alloca (sizeof *regno_src_regno * nregs); for (i = nregs; --i >= 0; ) regno_src_regno[i] = -1; - regmove_bb_head = (int *)alloca (sizeof (int) * (get_max_uid () + 1)); - for (i = get_max_uid (); i >= 0; i--) regmove_bb_head[i] = -1; + regmove_bb_head = (int *)alloca (sizeof (int) * (old_max_uid + 1)); + for (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1; for (i = 0; i < n_basic_blocks; i++) regmove_bb_head[INSN_UID (basic_block_head[i])] = i; @@ -1384,6 +1385,19 @@ regmove_optimize (f, nregs, regmove_dump_file) } } #endif /* REGISTER_CONSTRAINTS */ + + /* In fixup_match_1, some insns may have been inserted after basic block + ends. Fix that here. */ + for (i = 0; i < n_basic_blocks; i++) + { + rtx end = basic_block_end[i]; + rtx new = end; + rtx next = NEXT_INSN (new); + while (next != 0 && INSN_UID (next) >= old_max_uid + && (i == n_basic_blocks - 1 || basic_block_head[i + 1] != next)) + new = next, next = NEXT_INSN (new); + basic_block_end[i] = new; + } } /* Returns the INSN_CODE for INSN if its pattern has matching constraints for |