Patchwork [ARM] Remove redundant code in arm.c

login
register
mail settings
Submitter Andrew Stubbs
Date April 20, 2011, 12:55 p.m.
Message ID <4DAED7D3.8060406@codesourcery.com>
Download mbox | patch
Permalink /patch/92210/
State New
Headers show

Comments

Andrew Stubbs - April 20, 2011, 12:55 p.m.
This patch removes some redundant code that caused me some confusion.

It's not possible to construct a constant from multiple ORN 
instructions, just as it's not possible to do it with multiple AND 
instructions.

OK?

Andrew
Richard Earnshaw - April 20, 2011, 3:34 p.m.
On Wed, 2011-04-20 at 13:55 +0100, Andrew Stubbs wrote:
> This patch removes some redundant code that caused me some confusion.
> 
> It's not possible to construct a constant from multiple ORN 
> instructions, just as it's not possible to do it with multiple AND 
> instructions.
> 
> OK?
> 
> Andrew

OK.

R.
Andrew Stubbs - April 20, 2011, 4:16 p.m.
On 20/04/11 16:34, Richard Earnshaw wrote:
> On Wed, 2011-04-20 at 13:55 +0100, Andrew Stubbs wrote:
>> This patch removes some redundant code that caused me some confusion.
>>
>> It's not possible to construct a constant from multiple ORN
>> instructions, just as it's not possible to do it with multiple AND
>> instructions.
>>
>> OK?
>>
>> Andrew
>
> OK.

Committed, thanks.

Andrew

Patch

2011-04-20  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_gen_constant): Remove redundant can_invert.

---
 src/gcc-mainline/gcc/config/arm/arm.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/gcc-mainline/gcc/config/arm/arm.c b/src/gcc-mainline/gcc/config/arm/arm.c
index 533ad91..dee6f29 100644
--- a/src/gcc-mainline/gcc/config/arm/arm.c
+++ b/src/gcc-mainline/gcc/config/arm/arm.c
@@ -2745,9 +2745,6 @@  arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
 				gen_rtx_SET (VOIDmode, target, source));
 	  return 1;
 	}
-
-      if (TARGET_THUMB2)
-	can_invert = 1;
       break;
 
     case AND:
@@ -3238,8 +3235,7 @@  arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
     if (remainder & (1 << i))
       num_bits_set++;
 
-  if ((code == AND)
-      || (code != IOR && can_invert && num_bits_set > 16))
+  if ((code == AND) || (can_invert && num_bits_set > 16))
     remainder ^= 0xffffffff;
   else if (code == PLUS && num_bits_set > 16)
     remainder = (-remainder) & 0xffffffff;