Commit 1757e774 by Bernd Schmidt Committed by Bernd Schmidt

Prevent hoisting code from generating uninitialized accesses.

From-SVN: r40971
parent 886cbb88
2001-03-30 Bernd Schmidt <bernds@redhat.com>
* loop.c (load_mems): When generating a load from a pseudo, update
REGNO_LAST_UID.
Fri Mar 30 17:36:43 CEST 2001 Jan Hubicka <jh@suse.cz> Fri Mar 30 17:36:43 CEST 2001 Jan Hubicka <jh@suse.cz>
* i386.c (ix86_split_long_move): Use change address to compensate * i386.c (ix86_split_long_move): Use change address to compensate
......
...@@ -8811,7 +8811,7 @@ load_mems (loop) ...@@ -8811,7 +8811,7 @@ load_mems (loop)
struct loop_regs *regs = LOOP_REGS (loop); struct loop_regs *regs = LOOP_REGS (loop);
int maybe_never = 0; int maybe_never = 0;
int i; int i;
rtx p; rtx p, prev_ebb_head;
rtx label = NULL_RTX; rtx label = NULL_RTX;
rtx end_label; rtx end_label;
/* Nonzero if the next instruction may never be executed. */ /* Nonzero if the next instruction may never be executed. */
...@@ -8873,6 +8873,7 @@ load_mems (loop) ...@@ -8873,6 +8873,7 @@ load_mems (loop)
PREV_INSN (p) && GET_CODE (p) != CODE_LABEL; PREV_INSN (p) && GET_CODE (p) != CODE_LABEL;
p = PREV_INSN (p)) p = PREV_INSN (p))
; ;
prev_ebb_head = p;
cselib_init (); cselib_init ();
...@@ -8963,7 +8964,7 @@ load_mems (loop) ...@@ -8963,7 +8964,7 @@ load_mems (loop)
loop_info->mems[i].reg = reg; loop_info->mems[i].reg = reg;
/* Now, replace all references to the MEM with the /* Now, replace all references to the MEM with the
corresponding pesudos. */ corresponding pseudos. */
maybe_never = 0; maybe_never = 0;
for (p = next_insn_in_loop (loop, loop->scan_start); for (p = next_insn_in_loop (loop, loop->scan_start);
p != NULL_RTX; p != NULL_RTX;
...@@ -9034,7 +9035,7 @@ load_mems (loop) ...@@ -9034,7 +9035,7 @@ load_mems (loop)
if (CONSTANT_P (equiv->loc)) if (CONSTANT_P (equiv->loc))
const_equiv = equiv; const_equiv = equiv;
else if (GET_CODE (equiv->loc) == REG else if (GET_CODE (equiv->loc) == REG
/* Extending hard register lifetimes cuases crash /* Extending hard register lifetimes causes crash
on SRC targets. Doing so on non-SRC is on SRC targets. Doing so on non-SRC is
probably also not good idea, since we most probably also not good idea, since we most
probably have pseudoregister equivalence as probably have pseudoregister equivalence as
...@@ -9060,8 +9061,19 @@ load_mems (loop) ...@@ -9060,8 +9061,19 @@ load_mems (loop)
if (best_equiv) if (best_equiv)
best = copy_rtx (best_equiv->loc); best = copy_rtx (best_equiv->loc);
} }
set = gen_move_insn (reg, best); set = gen_move_insn (reg, best);
set = loop_insn_hoist (loop, set); set = loop_insn_hoist (loop, set);
if (REG_P (best))
{
for (p = prev_ebb_head; p != loop->start; p = NEXT_INSN (p))
if (REGNO_LAST_UID (REGNO (best)) == INSN_UID (p))
{
REGNO_LAST_UID (REGNO (best)) = INSN_UID (set);
break;
}
}
if (const_equiv) if (const_equiv)
REG_NOTES (set) = gen_rtx_EXPR_LIST (REG_EQUAL, REG_NOTES (set) = gen_rtx_EXPR_LIST (REG_EQUAL,
copy_rtx (const_equiv->loc), copy_rtx (const_equiv->loc),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment