aboutsummaryrefslogtreecommitdiff
path: root/gcc/sched.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1992-12-31 14:44:22 -0800
committerJim Wilson <wilson@gcc.gnu.org>1992-12-31 14:44:22 -0800
commite6b89e8bf27c932835b54313cc7e3a78bf07d0ce (patch)
tree03ead9b6eb6f5f1aabd997d26ed33ae234ed1fe9 /gcc/sched.c
parentb7d9fc385d6d5acf26f8c36d8cab92e44db3b56a (diff)
downloadgcc-e6b89e8bf27c932835b54313cc7e3a78bf07d0ce.zip
gcc-e6b89e8bf27c932835b54313cc7e3a78bf07d0ce.tar.gz
gcc-e6b89e8bf27c932835b54313cc7e3a78bf07d0ce.tar.bz2
(sched_analyze_1, sched_analyze_2): If before reloading,
record dependences that may be introduced by reload substituting equivalents for pseudo registers. From-SVN: r3036
Diffstat (limited to 'gcc/sched.c')
-rw-r--r--gcc/sched.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/sched.c b/gcc/sched.c
index 93bd06c..7df147a 100644
--- a/gcc/sched.c
+++ b/gcc/sched.c
@@ -1610,6 +1610,14 @@ sched_analyze_1 (x, insn)
add_dependence (insn, reg_last_sets[regno], REG_DEP_OUTPUT);
reg_last_sets[regno] = insn;
+ /* Pseudos that are REG_EQUIV to something may be replaced
+ by that during reloading, so we can potentially read
+ quantities mentioned in those addresses. */
+ if (! reload_completed)
+ if (reg_known_value[regno] != regno_reg_rtx[regno])
+ if (GET_CODE (reg_known_value[regno]) == MEM)
+ sched_analyze_2 (XEXP (reg_known_value[regno], 0), insn);
+
/* Don't let it cross a call after scheduling if it doesn't
already cross one. */
if (reg_n_calls_crossed[regno] == 0 && last_function_call)
@@ -1762,6 +1770,12 @@ sched_analyze_2 (x, insn)
if (reg_last_sets[regno])
add_dependence (insn, reg_last_sets[regno], 0);
+ /* Pseudos that are REG_EQUIV to something may be replaced
+ by that, so we depend on anything mentioned there too. */
+ if (! reload_completed)
+ if (reg_known_value[regno] != regno_reg_rtx[regno])
+ sched_analyze_2 (reg_known_value[regno], insn);
+
/* If the register does not already cross any calls, then add this
insn to the sched_before_next_call list so that it will still
not cross calls after scheduling. */