diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-19 21:30:48 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-19 21:30:48 +0000 |
commit | 8f7b24f32bb1cd58d00cd7a2603e2316852df74e (patch) | |
tree | 0b661dbf1b43ed00d7384a2ae1d1e8726d2c4dfb /gcc/jump.c | |
parent | c6abf2b89065e49e8ec7b51e1fa2dd1cc5f90a14 (diff) | |
download | gcc-8f7b24f32bb1cd58d00cd7a2603e2316852df74e.tar.gz |
* expr.c (do_jump_for_compare): Handle conditional branch expanders
emitting multiple jump instructions.
* jump.c (condjump_label): New function.
* rtl.h (condjump_label): Declare it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24773 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index d5af17c8ad9..47f5fd4cb7f 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -3402,6 +3402,32 @@ condjump_in_parallel_p (insn) return 0; } +/* Return the label of a conditional jump. */ + +rtx +condjump_label (insn) + rtx insn; +{ + register rtx x = PATTERN (insn); + + if (GET_CODE (x) == PARALLEL) + x = XVECEXP (x, 0, 0); + if (GET_CODE (x) != SET) + return NULL_RTX; + if (GET_CODE (SET_DEST (x)) != PC) + return NULL_RTX; + x = SET_SRC (x); + if (GET_CODE (x) == LABEL_REF) + return x; + if (GET_CODE (x) != IF_THEN_ELSE) + return NULL_RTX; + if (XEXP (x, 2) == pc_rtx && GET_CODE (XEXP (x, 1)) == LABEL_REF) + return XEXP (x, 1); + if (XEXP (x, 1) == pc_rtx && GET_CODE (XEXP (x, 2)) == LABEL_REF) + return XEXP (x, 2); + return NULL_RTX; +} + #ifdef HAVE_cc0 /* Return 1 if X is an RTX that does nothing but set the condition codes |