From patchwork Mon Oct 15 17:13:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Bolton X-Patchwork-Id: 191608 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1F31F2C00A8 for ; Tue, 16 Oct 2012 04:13:51 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350926032; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: From:To:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=GTZKQe53zyqJGdYil+316GPly3w=; b=cNWzY0IRs4uug2N lnQReNDvD+bHEy52ROzatosjl5g5E1i1IlWTCjZuheJWWsT6NWYsAgos5jWReGjE pHJRspVQ2rAxfwedA/KnXbTGaWtP/bgtkEBZn2mrOUmq3dCyvLc1hrKJt84oZ95F kdUwE3NYMQRmBOyKP1CxPthwyoqw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:From:To:Subject:Date:Message-ID:MIME-Version:X-MC-Unique:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=JmagUn6BAMsn1T2k1A73WPA7a/6PjUpfpxKP7D/g9G6HPEXrFVKkdf0StXKtO5 4EZZWs7Kh24a6MS+/SfyWgJ3BcYcykThnBdAdKuWFsEdXdP88HZ72sTzcRBNJT7U hXVCE0lajsYakxEdslHfeu/580LS2yl8XcE+5y6BlTuIo=; Received: (qmail 24744 invoked by alias); 15 Oct 2012 17:13:46 -0000 Received: (qmail 24734 invoked by uid 22791); 15 Oct 2012 17:13:45 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, MSGID_MULTIPLE_AT, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Oct 2012 17:13:40 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 15 Oct 2012 18:13:39 +0100 Received: from E102352xp ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 15 Oct 2012 18:13:38 +0100 From: "Ian Bolton" To: Subject: [PATCH][AArch64] Restrict usage of SBFIZ to valid range only Date: Mon, 15 Oct 2012 18:13:28 +0100 Message-ID: <000001cdaaf8$64f324c0$2ed96e40$@bolton@arm.com> MIME-Version: 1.0 X-MC-Unique: 112101518133900401 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk 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 This fixes an issue where we were generating an SBFIZ with operand 3 outside of the valid range (as determined by the size of the destination register and the amount of shift). My patch checks that the range is valid before allowing the pattern to be used. This has now had full regression testing and all is OK. OK for aarch64-trunk and aarch64-4_7-branch? Cheers, Ian 2012-10-15 Ian Bolton * gcc/config/aarch64/aarch64.md (_shft_): Restrict based on op2. ------------------------- diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index e6086a9..3bfe6e6 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -2311,7 +2311,7 @@ (ashift:GPI (ANY_EXTEND:GPI (match_operand:ALLX 1 "register_operand" "r")) (match_operand 2 "const_int_operand" "n")))] - "" + " <= ( - UINTVAL (operands[2]))" "bfiz\\t%0, %1, %2, #" [(set_attr "v8type" "bfm") (set_attr "mode" "")]