This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
problem with REG_DEAD
- To: gcc-patches at gcc dot gnu dot org
- Subject: problem with REG_DEAD
- From: Herman ten Brugge <Haj dot Ten dot Brugge at net dot HCC dot nl>
- Date: Mon, 29 Jan 2001 21:52:14 +0000 (WET)
Hello,
I found a problem when auto increment and scheduling is used. The problem
is in try_auto_increment in regmove.c. Here we try to use a post/pre
in/decrement INSN. If we succeed and the registers dies in the insn we
must change it into a REG_UNUSED. This is what flow generates for a post/pre
in/decrement INSN. If we do not do this the scheduling pass will dump
core because the number of DEAD's have changed.
Herman.
2001-01-29 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* regmove.c (try_auto_increment): Change REG_DEAD into REG_UNUSED
when register dies in the insn.
--- regmove.c.org Sat Jan 27 21:20:52 2001
+++ regmove.c Mon Jan 29 20:55:09 2001
@@ -146,6 +146,21 @@ try_auto_increment (insn, inc_insn, inc_
gen_rtx_fmt_e (inc_code, Pmode, reg), 1);
if (apply_change_group ())
{
+ rtx note;
+
+ /* Change any REG_DEAD note for register reg because
+ it will be changed into REG_UNUSED by flow. We have
+ to do this here or else this will causes problems in the
+ scheduling pass where we compare the number of
+ REG_DEAD's. */
+ note = find_reg_note (insn, REG_DEAD, reg);
+ if (note)
+ {
+ remove_note (insn, note);
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_UNUSED,
+ reg, REG_NOTES (insn));
+ }
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_INC,
reg, REG_NOTES (insn));