From patchwork Tue Sep 15 14:59:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 53679 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 8416A22DE5 for ; Tue, 15 Sep 2015 14:59:31 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf9261191wic.1 for ; Tue, 15 Sep 2015 07:59:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:x-original-sender :x-original-authentication-results; bh=UxDupnJMd5O7XW/tNGKVCjLwMf6A9EdmR9+5apAYaCg=; b=bnIFAm8nkJeBY/bdTH/y9KNzqtcufqfbK9raTLfqV8uN7frnTX40ZTWyMgQeKnb+K2 YZSu6Nit5bTrCV1o51dDJMkYJ7j1fu1l4A+0K9S3OkuFdhGUmu7WTppsCSHBcuknxfhR 17Iq+ZDA7LOAQn0ap0XC9gQi3SoqpXfsdleX9n3F6z8CfkaHPodNBRgBW0il69IDvuyF HGkSr2BMVFqV2UdZjXSwoBozMkVafhJCkDzYgTYRyGPXA+cDL59Pst9C3ckOFMTyTDjT QfFKFC5nLjjnE+fiz6qnXumv8kkmv3skKgx25aGV/mcPPWcXUNivYWmqD8yD2mSVaWm/ hqOQ== X-Gm-Message-State: ALoCoQluP/Uc1o+C/x7BayuJbsQ49Rf4dLVNSNNDLS95PTRi/mCeRQ4yaLfJwXu8ThCBmgU+EJSy X-Received: by 10.152.120.233 with SMTP id lf9mr73143lab.2.1442329170602; Tue, 15 Sep 2015 07:59:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.138 with SMTP id s10ls727405las.25.gmail; Tue, 15 Sep 2015 07:59:30 -0700 (PDT) X-Received: by 10.152.244.140 with SMTP id xg12mr12203761lac.93.1442329170440; Tue, 15 Sep 2015 07:59:30 -0700 (PDT) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id k3si8125016lag.91.2015.09.15.07.59.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 07:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by lbbvu2 with SMTP id vu2so14611010lbb.0 for ; Tue, 15 Sep 2015 07:59:29 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr22045882lbb.106.1442329169833; Tue, 15 Sep 2015 07:59:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1855996lbq; Tue, 15 Sep 2015 07:59:28 -0700 (PDT) X-Received: by 10.66.164.132 with SMTP id yq4mr48931187pab.8.1442329168376; Tue, 15 Sep 2015 07:59:28 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id zp7si32425323pac.216.2015.09.15.07.59.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 07:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-407462-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 2244 invoked by alias); 15 Sep 2015 14:59:13 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2231 invoked by uid 89); 15 Sep 2015 14:59:12 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Sep 2015 14:59:09 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-32-hl-1AqVfSQWm_ecfWctcCw-1; Tue, 15 Sep 2015 15:59:05 +0100 Received: from [10.2.207.50] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 15 Sep 2015 15:59:05 +0100 Message-ID: <55F83238.9090100@arm.com> Date: Tue, 15 Sep 2015 15:59:04 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Ramana Radhakrishnan , Richard Earnshaw Subject: [PATCH][ARM] Fix arm bootstrap failure due to -Werror=shift-negative-value X-MC-Unique: hl-1AqVfSQWm_ecfWctcCw-1 X-IsSubscribed: yes X-Original-Sender: kyrylo.tkachov@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi all, After Marek's patch I see the bootstrap failure on arm: gcc/config/arm/arm.c:4601:46: error: left shift of negative value [-Werror=shift-negative-value] && (val & (-1 << (32 - set_sign_bit_copies))) == val) I believe this is the right fix. Change -1 to HOST_WIDE_INT_M1U and change the type of val from HOST_WIDE_INT to unsigned HOST_WIDE_INT. This restores the bootstrap for me. Committing as obvious to restore bootstrap 2015-09-15 Kyrylo Tkachov * config/arm/arm.c (arm_gen_constant): Use HOST_WIDE_INT_M1U instead of -1 when shifting. Change type of val to unsigned HOST_WIDE_INT. Update prototype. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5f3180d..efb3a8b 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -95,7 +95,7 @@ static int arm_compute_static_chain_stack_bytes (void); static arm_stack_offsets *arm_get_frame_offsets (void); static void arm_add_gc_roots (void); static int arm_gen_constant (enum rtx_code, machine_mode, rtx, - HOST_WIDE_INT, rtx, rtx, int, int); + unsigned HOST_WIDE_INT, rtx, rtx, int, int); static unsigned bit_count (unsigned long); static unsigned feature_count (const arm_feature_set*); static int arm_address_register_rtx_p (rtx, int); @@ -4227,8 +4227,8 @@ emit_constant_insn (rtx cond, rtx pattern) static int arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond, - HOST_WIDE_INT val, rtx target, rtx source, int subtargets, - int generate) + unsigned HOST_WIDE_INT val, rtx target, rtx source, + int subtargets, int generate) { int can_invert = 0; int can_negate = 0; @@ -4598,7 +4598,7 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond, mvn r0, r0, asl #12 mvn r0, r0, lsr #12 */ if (set_sign_bit_copies > 8 - && (val & (-1 << (32 - set_sign_bit_copies))) == val) + && (val & (HOST_WIDE_INT_M1U << (32 - set_sign_bit_copies))) == val) { if (generate) {