From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13018 invoked by alias); 15 Jan 2015 15:12:53 -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 12880 invoked by uid 89); 15 Jan 2015 15:12:51 -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: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Jan 2015 15:12:47 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Thu, 15 Jan 2015 15:12:44 +0000 Received: from [10.1.205.157] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 Jan 2015 15:12:42 +0000 Message-ID: <54B7D8E9.5010004@arm.com> Date: Thu, 15 Jan 2015 15:40:00 -0000 From: Jiong Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Zhenqiang Chen , 'Richard Henderson' CC: Marcus Shawcroft , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH, AARCH64] Fix ICE in CCMP (PR64015) References: <000101d007a5$0d120f30$27362d90$@arm.com> <5472F2EA.9000702@redhat.com> <000001d0088b$a4590c40$ed0b24c0$@arm.com> <54744AEA.9010706@redhat.com> <000201d015e0$89a2f480$9ce8dd80$@arm.com> <548B4131.2030300@redhat.com> <000001d01842$eaa16be0$bfe443a0$@arm.com> In-Reply-To: <000001d01842$eaa16be0$bfe443a0$@arm.com> X-MC-Unique: 115011515124403501 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg01204.txt.bz2 On 15/12/14 08:41, Zhenqiang Chen wrote: > >> -----Original Message----- >> From: Richard Henderson [mailto:rth@redhat.com] >> Sent: Saturday, December 13, 2014 3:26 AM >> To: Zhenqiang Chen >> Cc: Marcus Shawcroft; gcc-patches@gcc.gnu.org >> Subject: Re: [PATCH, AARCH64] Fix ICE in CCMP (PR64015) >> >>> - tree lhs =3D gimple_assign_lhs (g); >>> enum machine_mode mode =3D TYPE_MODE (TREE_TYPE (lhs)); >>> rtx target =3D gen_reg_rtx (mode); >>> + >>> + start_sequence (); >>> tmp =3D emit_cstore (target, icode, NE, cc_mode, cc_mode, >>> 0, tmp, const0_rtx, 1, mode); >>> if (tmp) >>> - return tmp; >>> + { >>> + rtx seq =3D get_insns (); >>> + end_sequence (); >>> + emit_insn (prep_seq); >>> + emit_insn (gen_seq); >>> + emit_insn (seq); >>> + return tmp; >>> + } >>> + end_sequence (); >> Given that you're already doing delete_insns_since (last) at the end of = this >> function, I don't think you need a new sequence around the emit_cstore. >> Just >> >> emit_insn (prep_seq); >> emit_insn (gen_seq); >> tmp =3D emit_cstore (...); >> if (tmp) >> return tmp; > Updated. >=20=20=20 >>> + int unsignedp =3D code =3D=3D LTU || code =3D=3D LEU || code =3D=3D = GTU || code >>> + =3D=3D GEU; >> You don't need to examine the code, you can look at the argument: >> >> TYPE_UNSIGNED (TREE_TYPE (treeop0)) >=20=20=20 > Updated. >=20=20=20 >>> + op0 =3D prepare_operand (icode, op0, 2, op_mode, cmp_mode, >>> + unsignedp); >>> + op1 =3D prepare_operand (icode, op1, 3, op_mode, cmp_mode, >>> + unsignedp); if (!op0 || !op1) >>> + { >>> + end_sequence (); >>> + return NULL_RTX; >>> + } >>> + *prep_seq =3D get_insns (); >>> + end_sequence (); >>> + >>> + cmp =3D gen_rtx_fmt_ee ((enum rtx_code) code, cmp_mode, op0, op1); >>> + target =3D gen_rtx_REG (CCmode, CC_REGNUM); >>> + >>> + create_output_operand (&ops[0], target, CCmode); >>> + create_fixed_operand (&ops[1], cmp); create_fixed_operand (&ops[2], >>> + op0); create_fixed_operand (&ops[3], op1); >> Hmm. With so many fixed operands, I think you may be better off not >> creating the cmp expander in the first place. Just inline the >> SELECT_CC_MODE and everything right here. > In the patch, I use prepare_operand (icode, op0, 2, ...) to do the operan= d MODE conversion (from HI/QI to SI), which needs a cmp expander. Wit= hout it, I have to add additional codes to do the conversion (as it in prev= ious patch, which leads to PR64015). Ping~, verified this patch will pass speck2k6 build without ICE anymore. > > Thanks! > -Zhenqiang