From: Bob Wilson Date: Sat, 20 Sep 2008 02:43:00 +0000 (+0000) Subject: * config/xtensa/xtensa.md (reload_literal): Handle MEM operands. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=398857e4fbe5915a0d9a946ed6db4ac5c693ed77;p=platform%2Fupstream%2Fgcc.git * config/xtensa/xtensa.md (reload_literal): Handle MEM operands. From-SVN: r140509 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c39599..a56d27e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2008-09-19 Bob Wilson + + * config/xtensa/xtensa.md (reload_literal): Handle MEM operands. + 2008-09-19 Ian Lance Taylor * varasm.c (narrowing_initializer_constant_valid_p): Return diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 29119ed..abaf29d 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -898,13 +898,22 @@ rtx lit, scratch; unsigned word_off, byte_off; - gcc_assert (GET_CODE (operands[1]) == SUBREG); - lit = SUBREG_REG (operands[1]); - scratch = operands[2]; - word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1); - byte_off = SUBREG_BYTE (operands[1]) - word_off; + if (MEM_P (operands[1])) + { + lit = operands[1]; + word_off = 0; + byte_off = 0; + } + else + { + gcc_assert (GET_CODE (operands[1]) == SUBREG); + lit = SUBREG_REG (operands[1]); + word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1); + byte_off = SUBREG_BYTE (operands[1]) - word_off; + } lit = adjust_address (lit, SImode, word_off); + scratch = operands[2]; emit_insn (gen_movsi (scratch, lit)); emit_insn (gen_mov (operands[0], gen_rtx_SUBREG (mode, scratch, byte_off)));