From patchwork Wed Apr 20 12:55:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1124 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:49:21 -0000 Delivered-To: patches@linaro.org Received: by 10.224.67.148 with SMTP id r20cs112857qai; Wed, 20 Apr 2011 05:55:53 -0700 (PDT) Received: by 10.43.69.132 with SMTP id yc4mr1466864icb.221.1303304152869; Wed, 20 Apr 2011 05:55:52 -0700 (PDT) Received: from mail.codesourcery.com (mail.codesourcery.com [38.113.113.100]) by mx.google.com with ESMTPS id v15si2170899ibm.120.2011.04.20.05.55.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2011 05:55:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ams@codesourcery.com designates 38.113.113.100 as permitted sender) client-ip=38.113.113.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ams@codesourcery.com designates 38.113.113.100 as permitted sender) smtp.mail=ams@codesourcery.com Received: (qmail 19751 invoked from network); 20 Apr 2011 12:55:50 -0000 Received: from unknown (HELO ?192.168.0.104?) (ams@127.0.0.2) by mail.codesourcery.com with ESMTPA; 20 Apr 2011 12:55:50 -0000 Message-ID: <4DAED7D3.8060406@codesourcery.com> Date: Wed, 20 Apr 2011 13:55:47 +0100 From: Andrew Stubbs Organization: CodeSourcery User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: patches@linaro.org Subject: [PATCH][ARM] Remove redundant code in arm.c 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 2011-04-20 Andrew Stubbs 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;