This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Bug in my previous register elimination patch
- To: gcc-patches at gcc dot gnu dot org
- Subject: Bug in my previous register elimination patch
- From: Bernd Schmidt <bernds at cygnus dot co dot uk>
- Date: Tue, 2 Nov 1999 15:32:09 +0000 (GMT)
The patch below corrects a bug in the register elimination code. We
copy the body of an insn with copy_insn, but we don't copy the reg notes.
That causes at least one problem: find_reloads can no longer find the
REG_UNUSED note for a SCRATCH during the first passes. This means we
get RELOAD_OTHER reloads for these SCRATCHES during the first passes,
and RELOAD_FOR_INSN reloads in the last pass.
Bernd
* reload1.c (eliminate_regs_in_insn): Also copy reg notes.
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.178
diff -c -p -r1.178 reload1.c
*** reload1.c 1999/10/29 17:51:38 1.178
--- reload1.c 1999/11/02 15:26:41
*************** eliminate_regs_in_insn (insn, replace)
*** 3515,3521 ****
and one is inside RTL that has been copied while the other is not. */
new_body = old_body;
if (! replace)
! new_body = copy_insn (old_body);
PATTERN (insn) = new_body;
/* If we had a move insn but now we don't, rerecognize it. This will
--- 3071,3081 ----
and one is inside RTL that has been copied while the other is not. */
new_body = old_body;
if (! replace)
! {
! new_body = copy_insn (old_body);
! if (REG_NOTES (insn))
! REG_NOTES (insn) = copy_insn_1 (REG_NOTES (insn));
! }
PATTERN (insn) = new_body;
/* If we had a move insn but now we don't, rerecognize it. This will