aboutsummaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-06-29 05:44:27 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-06-29 05:44:27 -0400
commit60725c7844275e5a9aa1460053852003e9e6a6ea (patch)
treede4a6aa487e6f4821282b0ee827ef5d181eee078 /gcc/explow.c
parent100338dfc493aef6cfcaba4d6faca31fc4a6f0a8 (diff)
downloadgcc-60725c7844275e5a9aa1460053852003e9e6a6ea.zip
gcc-60725c7844275e5a9aa1460053852003e9e6a6ea.tar.gz
gcc-60725c7844275e5a9aa1460053852003e9e6a6ea.tar.bz2
(convert_memory_address, case PLUS): Fix error in last change.
From-SVN: r12378
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index b918294..ce5128b 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1,5 +1,5 @@
/* Subroutines for manipulating rtx's in semantically interesting ways.
- Copyright (C) 1987, 1991, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -331,10 +331,12 @@ convert_memory_address (to_mode, x)
case MULT:
/* For addition the second operand is a small constant, we can safely
permute the converstion and addition operation. We can always safely
- permute them if we are making the address narrower. */
+ permute them if we are making the address narrower. In addition,
+ always permute the operations if this is a constant. */
if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
|| (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (x) + 20000 < 40000))
+ && (INTVAL (XEXP (x, 1)) + 20000 < 40000
+ || CONSTANT_P (XEXP (x, 0)))))
return gen_rtx (GET_CODE (x), to_mode,
convert_memory_address (to_mode, XEXP (x, 0)),
convert_memory_address (to_mode, XEXP (x, 1)));