aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>1998-09-19 07:57:44 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>1998-09-19 07:57:44 +0000
commit9c8cc54f26b2b0b7fedf7029b9b8702bddac2635 (patch)
tree0d2d5a15724833ebde59a1a201e04441d1b90528
parent332072dbd12841f96ec5f6a5048777a8d7ad266d (diff)
downloadgcc-9c8cc54f26b2b0b7fedf7029b9b8702bddac2635.zip
gcc-9c8cc54f26b2b0b7fedf7029b9b8702bddac2635.tar.gz
gcc-9c8cc54f26b2b0b7fedf7029b9b8702bddac2635.tar.bz2
arm.c (bad_signed_byte_operand): Check both arms of a sum in a memory address.
* arm.c (bad_signed_byte_operand): Check both arms of a sum in a memory address. * arm.md (splits for *extendqihi_insn and *extendqisi_insn): Handle memory addresses that are not in standard canonical form. From-SVN: r22478
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c4
-rw-r--r--gcc/config/arm/arm.md12
3 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9c1bc65..37e4637 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -5,6 +5,11 @@ Sat Sep 19 07:33:36 1998 Richard Earnshaw (rearnsha@arm.com)
(arm_reorg): Handle cases where we need the address of an item in
the pool.
+ * arm.c (bad_signed_byte_operand): Check both arms of a sum in
+ a memory address.
+ * arm.md (splits for *extendqihi_insn and *extendqisi_insn): Handle
+ memory addresses that are not in standard canonical form.
+
Sat Sep 19 01:00:32 1998 Michael Hayes (mph@elec.canterbury.ac.nz)
* README.C4X: New file with information about the c4x ports.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7c2f9b1..9a808a8 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1769,7 +1769,9 @@ bad_signed_byte_operand (op, mode)
/* A sum of anything more complex than reg + reg or reg + const is bad */
if ((GET_CODE (op) == PLUS || GET_CODE (op) == MINUS)
- && ! s_register_operand (XEXP (op, 0), VOIDmode))
+ && (! s_register_operand (XEXP (op, 0), VOIDmode)
+ || (! s_register_operand (XEXP (op, 1), VOIDmode)
+ && GET_CODE (XEXP (op, 1)) != CONST_INT)))
return 1;
/* Big constants are also bad */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 5a313e4..18093c7 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -2399,6 +2399,12 @@
XEXP (operands[2], 0) = plus_constant (operands[3], low);
operands[1] = plus_constant (XEXP (operands[1], 0), offset - low);
}
+ /* Ensure the sum is in correct canonical form */
+ else if (GET_CODE (operands[1]) == PLUS
+ && GET_CODE (XEXP (operands[1], 1)) != CONST_INT
+ && ! s_register_operand (XEXP (operands[1], 1), VOIDmode))
+ operands[1] = gen_rtx (PLUS, GET_MODE (operands[1]),
+ XEXP (operands[1], 1), XEXP (operands[1], 0));
}
")
@@ -2464,6 +2470,12 @@
XEXP (operands[2], 0) = plus_constant (operands[0], low);
operands[1] = plus_constant (XEXP (operands[1], 0), offset - low);
}
+ /* Ensure the sum is in correct canonical form */
+ else if (GET_CODE (operands[1]) == PLUS
+ && GET_CODE (XEXP (operands[1], 1)) != CONST_INT
+ && ! s_register_operand (XEXP (operands[1], 1), VOIDmode))
+ operands[1] = gen_rtx (PLUS, GET_MODE (operands[1]),
+ XEXP (operands[1], 1), XEXP (operands[1], 0));
}
")