summaryrefslogtreecommitdiff
path: root/gcc/sched-deps.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-03 15:00:31 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-03 15:00:31 +0000
commit970c0c06160ffd4f71dab39c1fda2acbc1374281 (patch)
tree5e80d5382067671928972e5a252296864e7664ee /gcc/sched-deps.c
parentd8ae764760c1f07beeb7f7c73894c8222f93a45e (diff)
downloadgcc-970c0c06160ffd4f71dab39c1fda2acbc1374281.tar.gz
Improve alias analysis for ia64
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r--gcc/sched-deps.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 8d1e2f7ad2c..750285e38d8 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -74,6 +74,7 @@ static sbitmap *output_dependency_cache;
static sbitmap *forward_dependency_cache;
#endif
+static int deps_may_trap_p PARAMS ((rtx));
static void remove_dependence PARAMS ((rtx, rtx));
static void set_sched_group_p PARAMS ((rtx));
@@ -86,6 +87,21 @@ static rtx group_leader PARAMS ((rtx));
static rtx get_condition PARAMS ((rtx));
static int conditions_mutex_p PARAMS ((rtx, rtx));
+/* Return nonzero if a load of the memory reference MEM can cause a trap. */
+
+static int
+deps_may_trap_p (mem)
+ rtx mem;
+{
+ rtx addr = XEXP (mem, 0);
+
+ if (REG_P (addr)
+ && ORIGINAL_REGNO (addr) >= FIRST_PSEUDO_REGISTER
+ && reg_known_value[ORIGINAL_REGNO (addr)])
+ addr = reg_known_value[ORIGINAL_REGNO (addr)];
+ return rtx_addr_can_trap_p (addr);
+}
+
/* Return the INSN_LIST containing INSN in LIST, or NULL
if LIST does not contain INSN. */
@@ -817,7 +833,9 @@ sched_analyze_2 (deps, x, insn)
}
for (u = deps->last_pending_memory_flush; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ if (GET_CODE (XEXP (u, 0)) != JUMP_INSN
+ || deps_may_trap_p (x))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
/* Always add these dependencies to pending_reads, since
this insn may be followed by a write. */