From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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:00 -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 Content-Type: multipart/mixed; boundary="------------000405050503050001040509" X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01944.txt.bz2 This is a multi-part message in MIME format. --------------000405050503050001040509 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 839 Hi all, This RTL checking ICE occurs when processing an rtx_insn* in aarch64_madd_n= eeds_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 anywa= y. Bootstrapped and tested on trunk, GCC 5 and 4.9 configured with --enable-fi= x-cortex-a53-835769 --enable-checking=3Dyes,rtl. Ok for all branches? (the testcase passes on 4.8, presumably before the con= version 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. --------------000405050503050001040509 Content-Type: text/x-patch; name=aarch64-madd-insn.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="aarch64-madd-insn.patch" Content-length: 1159 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_m= add_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; =20 - if (recog_memoized (insn) < 0) + if (!INSN_P (insn) || recog_memoized (insn) < 0) return false; =20 attr_type =3D get_attr_type (insn); diff --git a/gcc/testsuite/gcc.target/aarch64/pr68363_1.c b/gcc/testsuite/g= cc.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; +} --------------000405050503050001040509--