diff options
author | wehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-15 19:25:43 +0000 |
---|---|---|
committer | wehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-15 19:25:43 +0000 |
commit | 2dcd83baa56239678afd819a18c1069cb2468c01 (patch) | |
tree | f447cb6b2c6dd7264add243638d8718cd3935065 /gcc/jump.c | |
parent | 9e644d8fbc8d4fd070c9c57d273938a2f6caf3b0 (diff) | |
download | gcc-2dcd83baa56239678afd819a18c1069cb2468c01.tar.gz |
* rtl.h (only_sets_cc0_p): New prototype.
* jump.c (sets_cc0_p): Handle INSN.
(only_sets_cc0_p): New function.
* flow.c (merge_blocks_nomove): Use only_sets_cc0_p.
(tidy_fallthru_edge): Likewise.
* integrate.c (copy_insn_list): Likewise.
* unroll.c (unroll_loop): Likewise.
(copy_loop_body): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44927 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 0b62ab42114..806e190822d 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1265,6 +1265,23 @@ onlyjump_p (insn) #ifdef HAVE_cc0 +/* Return non-zero if X is an RTX that only sets the condition codes + and has no side effects. */ + +int +only_sets_cc0_p (x) + rtx x; +{ + + if (! x) + return 0; + + if (INSN_P (x)) + x = PATTERN (x); + + return sets_cc0_p (x) == 1 && ! side_effects_p (x); +} + /* Return 1 if X is an RTX that does nothing but set the condition codes and CLOBBER or USE registers. Return -1 if X does explicitly set the condition codes, @@ -1272,8 +1289,15 @@ onlyjump_p (insn) int sets_cc0_p (x) - rtx x ATTRIBUTE_UNUSED; + rtx x; { + + if (! x) + return 0; + + if (INSN_P (x)) + x = PATTERN (x); + if (GET_CODE (x) == SET && SET_DEST (x) == cc0_rtx) return 1; if (GET_CODE (x) == PARALLEL) |