Commit 97c34bdb by Yufeng Zhang Committed by Yufeng Zhang

arm.c (arm_legitimize_address): Check xop1 is not a constant immediate before force_reg.

gcc/

	* config/arm/arm.c (arm_legitimize_address): Check xop1 is not
	a constant immediate before force_reg.

gcc/testsuite/

	* gcc.target/arm/20131120.c: New test.

From-SVN: r205397
parent 635bfae0
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
......@@ -7118,7 +7118,8 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
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
......
/* 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment