diff options
author | Steve Ellcey <sje@cup.hp.com> | 2007-03-21 16:02:32 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2007-03-21 16:02:32 +0000 |
commit | 17939c986e43ba302f9dd4adb7c6740902083ab3 (patch) | |
tree | 378aaf734885e7053c836665f0819e960fc4e4ab /gcc/explow.c | |
parent | b5cf27d7ec42156b78369cc0bdaabc34d1885191 (diff) | |
download | gcc-17939c986e43ba302f9dd4adb7c6740902083ab3.zip gcc-17939c986e43ba302f9dd4adb7c6740902083ab3.tar.gz gcc-17939c986e43ba302f9dd4adb7c6740902083ab3.tar.bz2 |
explow.c (convert_memory_address): Fold memory reference when POINTERS_EXTEND_UNSIGNED < 0
* explow.c (convert_memory_address): Fold memory reference when
POINTERS_EXTEND_UNSIGNED < 0
From-SVN: r123113
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index a710274..b2d4f52 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -382,12 +382,15 @@ convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED, case MULT: /* For addition we can safely permute the conversion and addition operation if one operand is a constant and converting the constant - does not change it. We can always safely permute them if we are - making the address narrower. */ + does not change it or if one operand is a constant and we are + using a ptr_extend instruction (POINTERS_EXTEND_UNSIGNED < 0). + We can always safely permute them if we are making the address + narrower. */ if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode) || (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT - && XEXP (x, 1) == convert_memory_address (to_mode, XEXP (x, 1)))) + && (XEXP (x, 1) == convert_memory_address (to_mode, XEXP (x, 1)) + || POINTERS_EXTEND_UNSIGNED < 0))) return gen_rtx_fmt_ee (GET_CODE (x), to_mode, convert_memory_address (to_mode, XEXP (x, 0)), XEXP (x, 1)); |