From: sje Date: Wed, 21 Mar 2007 16:02:32 +0000 (+0000) Subject: * explow.c (convert_memory_address): Fold memory reference when X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=2800ac1a18c0dff0ef43768959058f6ce5cb0b99;p=pf3gnuchains%2Fgcc-fork.git * explow.c (convert_memory_address): Fold memory reference when POINTERS_EXTEND_UNSIGNED < 0 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123113 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a53840e9793..c6f76cca7b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-02-21 Steve Ellcey + + * explow.c (convert_memory_address): Fold memory reference when + POINTERS_EXTEND_UNSIGNED < 0 + 2007-03-21 Richard Henderson PR target/31245 diff --git a/gcc/explow.c b/gcc/explow.c index a7102744710..b2d4f52969b 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));