sched-deps.c (sched_analyze_insn): Force volatile memory reads to be output before a branch.

* sched-deps.c (sched_analyze_insn): Force volatile memory reads
        to be output before a branch.

From-SVN: r42358
This commit is contained in:
Richard Henderson 2001-05-20 13:03:15 -07:00 committed by Richard Henderson
parent b161c5059b
commit d9214e537d
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2001-05-20 Richard Henderson <rth@redhat.com>
* sched-deps.c (sched_analyze_insn): Force volatile memory reads
to be output before a branch.
2001-05-20 Richard Henderson <rth@redhat.com>
* Makefile.in (dwarf2asm.o): Depend on $(TREE_H).

View File

@ -1044,12 +1044,25 @@ sched_analyze_insn (deps, x, insn, loop_notes)
CLEAR_REG_SET (&tmp);
/* All memory writes and volatile reads must happen before the
jump. Non-volatile reads must happen before the jump iff
the result is needed by the above register used mask. */
pending = deps->pending_write_insns;
pending_mem = deps->pending_write_mems;
while (pending)
{
add_dependence (insn, XEXP (pending, 0), REG_DEP_OUTPUT);
pending = XEXP (pending, 1);
pending_mem = XEXP (pending_mem, 1);
}
pending = deps->pending_read_insns;
pending_mem = deps->pending_read_mems;
while (pending)
{
if (MEM_VOLATILE_P (XEXP (pending_mem, 0)))
add_dependence (insn, XEXP (pending, 0), REG_DEP_OUTPUT);
pending = XEXP (pending, 1);
pending_mem = XEXP (pending_mem, 1);
}