diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-09 17:48:23 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-09 17:48:23 -0400 |
commit | 0cd301431298eec38f4b295de65fa30f973b982b (patch) | |
tree | e54ee0282361f708bfb89171877173f9f1c34a2d /gcc | |
parent | 9894a29157c45b6f6a0237c96729a1ad5de4183d (diff) | |
download | gcc-0cd301431298eec38f4b295de65fa30f973b982b.zip gcc-0cd301431298eec38f4b295de65fa30f973b982b.tar.gz gcc-0cd301431298eec38f4b295de65fa30f973b982b.tar.bz2 |
(rs6000_convert_preincs): New function.
From-SVN: r7013
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0cadc31..04a3c3d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -157,6 +157,34 @@ rs6000_override_options () } } +/* Look for an PRE_INC address in X that are marked as dying in INSN. + Convert the addresses to a PLUS form if one is found. */ + +void +rs6000_convert_preincs (x, insn) + rtx x; + rtx insn; +{ + enum rtx_code code = GET_CODE (x); + char *fmt; + int i, j; + + if (code == MEM && GET_CODE (XEXP (x, 0)) == PRE_INC + && find_reg_note (insn, REG_DEAD, XEXP (XEXP (x, 0), 0))) + XEXP (x, 0) = plus_constant (XEXP (XEXP (x, 0), 0), + GET_MODE_SIZE (GET_MODE (x))); + else + for (i = GET_RTX_LENGTH (code) - 1, fmt = GET_RTX_FORMAT (code); + i >= 0; i--) + { + if (fmt[i] == 'e') + rs6000_convert_preincs (XEXP (x, i), insn); + else if (fmt[i] == 'E') + for (j = XVECLEN (x, i) - 1; j >= 0; j--) + rs6000_convert_preincs (XVECEXP (x, i, j), insn); + } +} + /* Return non-zero if this function is known to have a null epilogue. */ int |