diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-20 20:03:15 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-20 20:03:15 +0000 |
commit | 9807cfe1f6de4f0f568edfa633b2830dbcd9eda2 (patch) | |
tree | ef588464921b3bbf64f226e7bea4390a4d198e50 /gcc/sched-deps.c | |
parent | 79f9bb29b34c3857fa190d815d036ef4291b04d5 (diff) | |
download | gcc-9807cfe1f6de4f0f568edfa633b2830dbcd9eda2.tar.gz |
* sched-deps.c (sched_analyze_insn): Force volatile memory reads
to be output before a branch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42358 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r-- | gcc/sched-deps.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index ecdf28212ba..d303e7a86df 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -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); } |