From patchwork Thu Sep 1 15:29:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 3844 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B83D123F25 for ; Thu, 1 Sep 2011 15:29:31 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id A6335A18ACD for ; Thu, 1 Sep 2011 15:29:31 +0000 (UTC) Received: by fxd18 with SMTP id 18so1142545fxd.11 for ; Thu, 01 Sep 2011 08:29:31 -0700 (PDT) Received: by 10.223.62.8 with SMTP id v8mr515302fah.43.1314890971524; Thu, 01 Sep 2011 08:29:31 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs56290lab; Thu, 1 Sep 2011 08:29:31 -0700 (PDT) Received: by 10.227.38.201 with SMTP id c9mr350637wbe.69.1314890970617; Thu, 01 Sep 2011 08:29:30 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id em13si431068wbb.38.2011.09.01.08.29.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Sep 2011 08:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of andrew.stubbs@gmail.com designates 74.125.82.178 as permitted sender) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of andrew.stubbs@gmail.com designates 74.125.82.178 as permitted sender) smtp.mail=andrew.stubbs@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by wyg19 with SMTP id 19so1674710wyg.37 for ; Thu, 01 Sep 2011 08:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=GaOzjrlmwsVfcTh4X82QShfZH2vt4ASC3O6SSYpTlwQ=; b=KKkOpfT6BH46wKJqeGQ1gPK7Bk7UHJgdDyapy2HcCMwC2WBbaONkls8iyUWqm6vPQU XPX0wkGn88DwoRvEJsntQ+McX2IL/Vo+AVEmbbObHGBwcF4hDVqaJQ7BnK17wg/Q4Bsb +3LO3aUUYZ/oQahSvB8w34xnSGWJWhzfnnQqI= Received: by 10.227.128.21 with SMTP id i21mr1709969wbs.68.1314890970335; Thu, 01 Sep 2011 08:29:30 -0700 (PDT) Received: from [192.168.0.104] (cpc2-hawk4-0-0-cust828.aztw.cable.virginmedia.com [82.32.123.61]) by mx.google.com with ESMTPS id fj19sm118918wbb.66.2011.09.01.08.29.27 (version=SSLv3 cipher=OTHER); Thu, 01 Sep 2011 08:29:28 -0700 (PDT) Message-ID: <4E5FA4D5.9050309@codesourcery.com> Date: Thu, 01 Sep 2011 16:29:25 +0100 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: "Joseph S. Myers" CC: gcc-patches@gcc.gnu.org, patches@linaro.org Subject: Re: [PATCH][ARM] pr50193: ICE on a | (b << negative-constant) References: <4E5F6B5F.2020207@codesourcery.com> <4E5FA41F.9010201@codesourcery.com> In-Reply-To: <4E5FA41F.9010201@codesourcery.com> On 01/09/11 16:26, Andrew Stubbs wrote: > OK, fair enough, redundant or not, here's a patch with belt and braces. > > OK now? And again, with the patch .... Andrew 2011-09-01 Andrew Stubbs gcc/ * config/arm/predicates.md (shift_amount_operand): Ensure shift amount is in the range 1..mode_size-1. gcc/testsuite/ * gcc.dg/pr50193-1.c: New file. --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -132,7 +132,9 @@ (define_predicate "shift_amount_operand" (ior (and (match_test "TARGET_ARM") (match_operand 0 "s_register_operand")) - (match_operand 0 "const_int_operand"))) + (and (match_operand 0 "const_int_operand") + (match_test "INTVAL (op) > 0 + && INTVAL (op) <= GET_MODE_PRECISION (mode)")))) (define_predicate "arm_add_operand" (ior (match_operand 0 "arm_rhs_operand") --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr50193-1.c @@ -0,0 +1,10 @@ +/* PR 50193: ARM: ICE on a | (b << negative-constant) */ +/* Ensure that the compiler doesn't ICE. */ + +/* { dg-options "-O2" } */ + +int +foo(int a, int b) +{ + return a | (b << -3); /* { dg-warning "left shift count is negative" } */ +}