+2013-11-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * config/arm/arm.c (arm_legitimize_address): Check xop1 is not
+ a constant immediate before force_reg.
+
2013-11-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/59245
if (CONSTANT_P (xop0) && !symbol_mentioned_p (xop0))
xop0 = force_reg (SImode, xop0);
- if (CONSTANT_P (xop1) && !symbol_mentioned_p (xop1))
+ if (CONSTANT_P (xop1) && !CONST_INT_P (xop1)
+ && !symbol_mentioned_p (xop1))
xop1 = force_reg (SImode, xop1);
if (ARM_BASE_REGISTER_RTX_P (xop0)
+2013-11-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * gcc.target/arm/20131120.c: New test.
+
2013-11-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/59245
--- /dev/null
+/* Check that CONST_INT is not forced into REG before PLUS. */
+/* { dg-do compile { target { arm_arm_ok || arm_thumb2_ok} } } */
+/* { dg-options "-O2 -fdump-rtl-expand" } */
+
+typedef int Arr2[50][50];
+
+void
+foo (Arr2 a2, int i)
+{
+ a2[i+20][i] = 1;
+}
+
+/* { dg-final { scan-rtl-dump-not "\\\(set \\\(reg:SI \[0-9\]*\\\)\[\n\r\]+\[ \t]*\\\(const_int 4000" "expand" } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */