aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2008-04-08 09:04:04 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2008-04-08 09:04:04 +0000
commit582be0a107e90be99658ff9d7b85b17430cbc864 (patch)
treef6b5cb4628930e1b9b81689b21ffcdbc2417bd42 /gcc
parent38173d38cc4d944f209f1b2e0101fb176ac21e84 (diff)
downloadgcc-582be0a107e90be99658ff9d7b85b17430cbc864.zip
gcc-582be0a107e90be99658ff9d7b85b17430cbc864.tar.gz
gcc-582be0a107e90be99658ff9d7b85b17430cbc864.tar.bz2
cris.c (cris_address_cost): For a PLUS, swap tem1 and tem2 if tem1 is not a REG or MULT.
* config/cris/cris.c (cris_address_cost): For a PLUS, swap tem1 and tem2 if tem1 is not a REG or MULT. From-SVN: r134088
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/cris/cris.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 076abb3..af44893 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-08 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/cris.c (cris_address_cost): For a PLUS, swap tem1
+ and tem2 if tem1 is not a REG or MULT.
+
2008-04-08 Jan Hubicka <jh@suse.cz>
* function.h (incomming_args): Break out of struct function.
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 85a944b..87fef5a 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1883,7 +1883,12 @@ cris_address_cost (rtx x)
rtx tem1 = XEXP (x, 0);
rtx tem2 = XEXP (x, 1);
- /* We'll "assume" canonical RTX. */
+ /* Local extended canonicalization rule: the first operand must
+ be REG, unless it's an operation (MULT). */
+ if (!REG_P (tem1) && GET_CODE (tem1) != MULT)
+ tem1 = tem2, tem2 = XEXP (x, 0);
+
+ /* We'll "assume" we have canonical RTX now. */
gcc_assert (REG_P (tem1) || GET_CODE (tem1) == MULT);
/* A BIAP is 2 extra bytes for the prefix insn, nothing more. We