diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-05-15 13:23:58 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-05-15 13:23:58 -0400 |
commit | b45863ecee4523fcb7822702eba1bed616e45563 (patch) | |
tree | ab70d17a8ee9930d96fa3fa0c1721602983df496 | |
parent | fe33bfb3e0604634bfeb1b7c77bd495697054327 (diff) | |
download | gcc-b45863ecee4523fcb7822702eba1bed616e45563.zip gcc-b45863ecee4523fcb7822702eba1bed616e45563.tar.gz gcc-b45863ecee4523fcb7822702eba1bed616e45563.tar.bz2 |
(movqi, movhi, movsi): Make sure that address returned from
force_const_mem is valid.
From-SVN: r4475
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 91bcbab..a9272ba 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -2090,7 +2090,13 @@ operands[1] = force_reg (SImode, operands[1]); if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT) - operands[1] = force_const_mem (SImode, operands[1]); + { + operands[1] = force_const_mem (SImode, operands[1]); + if (! memory_address_p (SImode, XEXP (operands[1], 0)) + && ! reload_in_progress) + operands[1] = change_address (operands[1], SImode, + XEXP (operands[1], 0)); + } if (GET_CODE (operands[1]) == CONST_INT && (unsigned) (INTVAL (operands[1]) + 0x8000) >= 0x10000 @@ -2162,7 +2168,13 @@ operands[1] = force_reg (HImode, operands[1]); if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT) - operands[1] = force_const_mem (HImode, operands[1]); + { + operands[1] = force_const_mem (HImode, operands[1]); + if (! memory_address_p (HImode, XEXP (operands[1], 0)) + && ! reload_in_progress) + operands[1] = change_address (operands[1], HImode, + XEXP (operands[1], 0)); + } }") (define_insn "" @@ -2190,7 +2202,13 @@ operands[1] = force_reg (QImode, operands[1]); if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT) - operands[1] = force_const_mem (QImode, operands[1]); + { + operands[1] = force_const_mem (QImode, operands[1]); + if (! memory_address_p (QImode, XEXP (operands[1], 0)) + && ! reload_in_progress) + operands[1] = change_address (operands[1], QImode, + XEXP (operands[1], 0)); + } }") (define_insn "" |