From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83977 invoked by alias); 20 Nov 2015 09:16:24 -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 83962 invoked by uid 89); 20 Nov 2015 09:16:22 -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; Fri, 20 Nov 2015 09:16:20 +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-13-yDhkM_LoTZa-NztxBx-4KQ-1; Fri, 20 Nov 2015 09:16:14 +0000 Received: from [10.2.206.200] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 20 Nov 2015 09:16:14 +0000 Message-ID: <564EE4DE.8090600@arm.com> Date: Fri, 20 Nov 2015 09:16: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: Bernd Schmidt , GCC Patches CC: Jeff Law Subject: Re: [PATCH][RTL-ree] PR rtl-optimization/68194: Restrict copy instruction in presence of conditional moves References: <5649E333.4090904@arm.com> <564A2339.3030308@redhat.com> <564AEE94.3070708@arm.com> <564B1934.6050300@redhat.com> <564B259A.90206@arm.com> <564BB42C.1020401@redhat.com> <564C40D1.80409@arm.com> <564DA454.2080704@arm.com> <564E7A47.1090404@redhat.com> In-Reply-To: <564E7A47.1090404@redhat.com> X-MC-Unique: yDhkM_LoTZa-NztxBx-4KQ-1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02448.txt.bz2 On 20/11/15 01:41, Bernd Schmidt wrote: >>> I1 is def_insn, I3 is cand->insn. tmp_reg is 'ax'. What we want to do >>> is reject this transformation >>> because the destination of def_insn (aka I1), that is 'ax', is not the >>> operand of the extend operation >>> in cand->insn (aka I3). As you said, rtx_equal won't work on just >>> SET_SRC (PATTERN (cand->insn)) because >>> it's an extend operation. So reg_overlap_mentioned should be appropriat= e. > > Yeah, so just use the src_reg variable for the comparison. I still don't = see why you wouldn't want to use the stronger test. But the whole thing sti= ll feels not completely ideal somehow, so after reading through ree.c for a= while and=20 > getting a better feeling for how it works, I think the following (which y= ou said is equivalent) would be the most understandable and direct fix. > > You said that the two tests should be equivalent, and I agree. I've not f= ound cases where the change makes a difference, other than the testcase. Wo= uld you mind running this version through the testsuite and committing if i= t passes? > > I've shrunk the comment; massive explanations like this for every bug are= inappropriate IMO, and the example also duplicates an earlier comment in t= he same function. And, as I said earlier, the way you placed the comment is= confusing=20 > because only one part of the following if statement is related to it. > Ok, thanks for the explanation. When investigating this bug I tried a patch identical to yours and it had w= orked just fine. My patch was just an alternative approach to the same issue. I'll retest it just to double-check and I'll incorporate the testsuite addi= tions. Thanks for your help! Kyrill > > Bernd