diff options
author | rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-29 21:07:37 +0000 |
---|---|---|
committer | rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-29 21:07:37 +0000 |
commit | bbb82bbf2e7663e15d60b83225ae3e363c55c11d (patch) | |
tree | b7474d4fdb7d9ed9d0210dacaa8e9f133f277f5d /gcc/sched-deps.c | |
parent | 61fd88eda7f41de7b3dcb896b2579644c6ae7cba (diff) | |
download | gcc-bbb82bbf2e7663e15d60b83225ae3e363c55c11d.tar.gz |
* sched-deps.c (get_condition): Rewrite using jump support functions.
Use reversed_comparison_code.
(conditions_mutex_p): Use reversed_comparison_code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86736 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r-- | gcc/sched-deps.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 7b8496c8c8e..18f3d39a9c0 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -145,23 +145,25 @@ get_condition (rtx insn) if (pat == 0) return 0; + if (GET_CODE (pat) == COND_EXEC) return COND_EXEC_TEST (pat); - if (!JUMP_P (insn)) - return 0; - if (GET_CODE (pat) != SET || SET_SRC (pat) != pc_rtx) - return 0; - if (GET_CODE (SET_DEST (pat)) != IF_THEN_ELSE) + + if (!any_condjump_p (insn) || !onlyjump_p (insn)) return 0; - pat = SET_DEST (pat); - cond = XEXP (pat, 0); - if (GET_CODE (XEXP (cond, 1)) == LABEL_REF - && XEXP (cond, 2) == pc_rtx) + + cond = XEXP (SET_SRC (pc_set (insn)), 0); + if (XEXP (cond, 2) == pc_rtx) return cond; - else if (GET_CODE (XEXP (cond, 2)) == LABEL_REF - && XEXP (cond, 1) == pc_rtx) - return gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)), GET_MODE (cond), - XEXP (cond, 0), XEXP (cond, 1)); + else if (XEXP (cond, 1) == pc_rtx) + { + enum rtx_code revcode = reversed_comparison_code (cond, insn); + + if (revcode == UNKNOWN) + return 0; + return gen_rtx_fmt_ee (revcode, GET_MODE (cond), XEXP (cond, 0), + XEXP (cond, 1)); + } else return 0; } @@ -173,7 +175,7 @@ conditions_mutex_p (rtx cond1, rtx cond2) { if (COMPARISON_P (cond1) && COMPARISON_P (cond2) - && GET_CODE (cond1) == reverse_condition (GET_CODE (cond2)) + && GET_CODE (cond1) == reversed_comparison_code (cond2, NULL) && XEXP (cond1, 0) == XEXP (cond2, 0) && XEXP (cond1, 1) == XEXP (cond2, 1)) return 1; |