From patchwork Mon Nov 16 13:21:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 56605 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1311401lbb; Mon, 16 Nov 2015 05:22:10 -0800 (PST) X-Received: by 10.66.233.73 with SMTP id tu9mr54391342pac.52.1447680126550; Mon, 16 Nov 2015 05:22:06 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id yk3si22684463pab.137.2015.11.16.05.22.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2015 05:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-414228-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-return-414228-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-414228-patch=linaro.org@gcc.gnu.org; dkim=pass header.i=@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=iuwV23un+UCWx9U2Gd1ZofopTWlllVk9Fd1w1nHxPr1 yNOfJGuoy/Lz0FtRNGWfGNiCQWt3zqiFmAS40thFayQ3lKVmYZrajONnsp200xqg cHl8U8MvfRmn6HqPkyKjNts7BzeM/oY/2zFpgM2z3ALxZ6oBCFN1qZ9zqFzShCvg = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=iZUF+lTIjBSebrUOltk71vovMyA=; b=uaYQE3K8He48W3ZmT MJ+H0dtlTHi2w0imqQ2bF3heZahYl0As6Lm9dNamOcWqqRdp5uWYytqdG2KTxhae xrxoHK4ZUsm1Py8+a+W0/eOBJfaOMBeMk8WObfPmXLbr+NekhZRnnn1FfN2Acwli OuKH8cQWKt/8IyZeFSnu/2y2DU= Received: (qmail 92556 invoked by alias); 16 Nov 2015 13:21:55 -0000 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 Received: (qmail 92540 invoked by uid 89); 16 Nov 2015 13:21:54 -0000 Authentication-Results: sourceware.org; auth=none 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) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Nov 2015 13:21:53 +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-35-XqLk_LwwQPOQzP3k4L--Ng-1; Mon, 16 Nov 2015 13:21:48 +0000 Received: from [10.2.206.200] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 16 Nov 2015 13:21:48 +0000 Message-ID: <5649D86C.4010409@arm.com> Date: Mon, 16 Nov 2015 13:21:48 +0000 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: Marcus Shawcroft , Richard Earnshaw , James Greenhalgh Subject: [PATCH][AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop X-MC-Unique: XqLk_LwwQPOQzP3k4L--Ng-1 X-IsSubscribed: yes Hi all, This RTL checking ICE occurs when processing an rtx_insn* in aarch64_madd_needs_nop that apparently holds JUMP_TABLE_DATA. This shouldn't be passed to recog. So instead reject it with the INSN_P check. Such rtx_insns are not relevant to the code in aarch64_madd_needs_nop anyway. Bootstrapped and tested on trunk, GCC 5 and 4.9 configured with --enable-fix-cortex-a53-835769 --enable-checking=yes,rtl. Ok for all branches? (the testcase passes on 4.8, presumably before the conversion to rtx_insn) Thanks, Kyrill 2015-11-16 Kyrylo Tkachov PR target/68363 * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Reject arguments that are not INSN_P. 2015-11-16 Kyrylo Tkachov PR target/68363 * gcc.target/aarch64/pr68363_1.c: New test. commit a2fa69050c8a0dc824f5892f01385acdf35c54cc Author: Kyrylo Tkachov Date: Mon Nov 16 09:18:14 2015 +0000 [AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 19dfc51..0b02f1e 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10105,7 +10105,7 @@ aarch64_madd_needs_nop (rtx_insn* insn) if (!TARGET_FIX_ERR_A53_835769) return false; - if (recog_memoized (insn) < 0) + if (!INSN_P (insn) || recog_memoized (insn) < 0) return false; attr_type = get_attr_type (insn); diff --git a/gcc/testsuite/gcc.target/aarch64/pr68363_1.c b/gcc/testsuite/gcc.target/aarch64/pr68363_1.c new file mode 100644 index 0000000..bb294b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr68363_1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-mfix-cortex-a53-835769" } */ + +int +foo (int i) +{ + switch (i) + { + case 0: + case 2: + case 5: + return 0; + case 7: + case 11: + case 13: + return 1; + } + return -1; +}